OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_QUEUE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_QUEUE_CONTROLLER_H_ |
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_QUEUE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_QUEUE_CONTROLLER_H_ |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "components/content_settings/core/common/content_settings.h" | 10 #include "components/content_settings/core/common/content_settings.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 PermissionQueueController(Profile* profile, | 33 PermissionQueueController(Profile* profile, |
34 content::PermissionType permission_type, | 34 content::PermissionType permission_type, |
35 ContentSettingsType content_settings_type); | 35 ContentSettingsType content_settings_type); |
36 ~PermissionQueueController() override; | 36 ~PermissionQueueController() override; |
37 | 37 |
38 // The InfoBar will be displayed immediately if the tab is not already | 38 // The InfoBar will be displayed immediately if the tab is not already |
39 // displaying one, otherwise it'll be queued. | 39 // displaying one, otherwise it'll be queued. |
40 void CreateInfoBarRequest(const PermissionRequestID& id, | 40 void CreateInfoBarRequest(const PermissionRequestID& id, |
41 const GURL& requesting_frame, | 41 const GURL& requesting_frame, |
42 const GURL& embedder, | 42 const GURL& embedder, |
| 43 bool user_gesture, |
43 const PermissionDecidedCallback& callback); | 44 const PermissionDecidedCallback& callback); |
44 | 45 |
45 // Cancels a specific infobar request. | 46 // Cancels a specific infobar request. |
46 void CancelInfoBarRequest(const PermissionRequestID& id); | 47 void CancelInfoBarRequest(const PermissionRequestID& id); |
47 | 48 |
48 // Called by the InfoBarDelegate to notify permission has been set. | 49 // Called by the InfoBarDelegate to notify permission has been set. |
49 // It'll notify and dismiss any other pending InfoBar request for the same | 50 // It'll notify and dismiss any other pending InfoBar request for the same |
50 // |requesting_frame| and embedder. | 51 // |requesting_frame| and embedder. |
51 void OnPermissionSet(const PermissionRequestID& id, | 52 void OnPermissionSet(const PermissionRequestID& id, |
52 const GURL& requesting_frame, | 53 const GURL& requesting_frame, |
53 const GURL& embedder, | 54 const GURL& embedder, |
| 55 bool user_gesture, |
54 bool update_content_setting, | 56 bool update_content_setting, |
55 bool allowed); | 57 bool allowed); |
56 | 58 |
57 // Performs the update to content settings for a particular request frame | 59 // Performs the update to content settings for a particular request frame |
58 // context. | 60 // context. |
59 void UpdateContentSetting( | 61 void UpdateContentSetting( |
60 const GURL& requesting_frame, const GURL& embedder, bool allowed); | 62 const GURL& requesting_frame, const GURL& embedder, bool allowed); |
61 | 63 |
62 protected: | 64 protected: |
63 // content::NotificationObserver: | 65 // content::NotificationObserver: |
(...skipping 28 matching lines...) Expand all Loading... |
92 Profile* const profile_; | 94 Profile* const profile_; |
93 content::PermissionType permission_type_; | 95 content::PermissionType permission_type_; |
94 ContentSettingsType content_settings_type_; | 96 ContentSettingsType content_settings_type_; |
95 PendingInfobarRequests pending_infobar_requests_; | 97 PendingInfobarRequests pending_infobar_requests_; |
96 bool in_shutdown_; | 98 bool in_shutdown_; |
97 | 99 |
98 DISALLOW_COPY_AND_ASSIGN(PermissionQueueController); | 100 DISALLOW_COPY_AND_ASSIGN(PermissionQueueController); |
99 }; | 101 }; |
100 | 102 |
101 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_QUEUE_CONTROLLER_H_ | 103 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_QUEUE_CONTROLLER_H_ |
OLD | NEW |