[email protected] | efad90f | 2014-01-17 00:45:54 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
Clark DuVall | 484c256 | 2020-01-23 22:05:09 | [diff] [blame] | 5 | #ifndef COMPONENTS_PERMISSIONS_PERMISSION_REQUEST_H_ |
6 | #define COMPONENTS_PERMISSIONS_PERMISSION_REQUEST_H_ | ||||
[email protected] | efad90f | 2014-01-17 00:45:54 | [diff] [blame] | 7 | |
Jan Wilken Dörrie | ad587c3 | 2021-03-11 14:09:27 | [diff] [blame] | 8 | #include <string> |
9 | |||||
dominickn | d4e446a | 2016-09-13 07:44:13 | [diff] [blame] | 10 | #include "base/macros.h" |
Clark DuVall | 484c256 | 2020-01-23 22:05:09 | [diff] [blame] | 11 | #include "build/build_config.h" |
lshang | ada00c1 | 2016-10-17 04:51:10 | [diff] [blame] | 12 | #include "components/content_settings/core/common/content_settings_types.h" |
Andy Paicu | 4a88f42 | 2020-11-12 18:21:39 | [diff] [blame] | 13 | #include "components/permissions/permission_request_enums.h" |
Anton Bikineev | 1156b5f | 2021-05-15 22:35:36 | [diff] [blame] | 14 | #include "third_party/abseil-cpp/absl/types/optional.h" |
[email protected] | d23cdeee | 2014-03-10 06:39:53 | [diff] [blame] | 15 | #include "url/gurl.h" |
[email protected] | efad90f | 2014-01-17 00:45:54 | [diff] [blame] | 16 | |
Clark DuVall | 484c256 | 2020-01-23 22:05:09 | [diff] [blame] | 17 | namespace permissions { |
Bret Sepulveda | 362cce4 | 2021-01-13 18:47:54 | [diff] [blame] | 18 | enum class RequestType; |
Clark DuVall | 484c256 | 2020-01-23 22:05:09 | [diff] [blame] | 19 | |
tsergeant | 58defcfb | 2016-07-19 23:47:28 | [diff] [blame] | 20 | // Describes the interface a feature making permission requests should |
21 | // implement. A class of this type is registered with the permission request | ||||
[email protected] | efad90f | 2014-01-17 00:45:54 | [diff] [blame] | 22 | // manager to receive updates about the result of the permissions request |
tsergeant | 58defcfb | 2016-07-19 23:47:28 | [diff] [blame] | 23 | // from the bubble or infobar. It should live until it is unregistered or until |
[email protected] | 634e598 | 2014-04-18 19:20:48 | [diff] [blame] | 24 | // RequestFinished is called. |
[email protected] | efad90f | 2014-01-17 00:45:54 | [diff] [blame] | 25 | // Note that no particular guarantees are made about what exact UI surface |
26 | // is presented to the user. The delegate may be coalesced with other bubble | ||||
27 | // requests, or depending on the situation, not shown at all. | ||||
tsergeant | 58defcfb | 2016-07-19 23:47:28 | [diff] [blame] | 28 | class PermissionRequest { |
[email protected] | efad90f | 2014-01-17 00:45:54 | [diff] [blame] | 29 | public: |
dominickn | d4e446a | 2016-09-13 07:44:13 | [diff] [blame] | 30 | PermissionRequest(); |
tsergeant | 58defcfb | 2016-07-19 23:47:28 | [diff] [blame] | 31 | virtual ~PermissionRequest() {} |
[email protected] | efad90f | 2014-01-17 00:45:54 | [diff] [blame] | 32 | |
Bret Sepulveda | 362cce4 | 2021-01-13 18:47:54 | [diff] [blame] | 33 | // The type of this request. |
34 | virtual RequestType GetRequestType() const = 0; | ||||
[email protected] | d23cdeee | 2014-03-10 06:39:53 | [diff] [blame] | 35 | |
Bret Sepulveda | d7e4d44 | 2021-04-20 13:46:41 | [diff] [blame] | 36 | // Whether |this| and |other_request| are duplicates and therefore don't both |
37 | // need to be shown in the UI. | ||||
38 | virtual bool IsDuplicateOf(PermissionRequest* other_request) const; | ||||
39 | |||||
timloh | aa3ce26 | 2017-06-01 05:29:40 | [diff] [ |