| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ | 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // | 23 // |
| 24 // A PermissionBubbleManager is associated with a particular WebContents. | 24 // A PermissionBubbleManager is associated with a particular WebContents. |
| 25 // Requests attached to a particular WebContents' PBM must outlive it. | 25 // Requests attached to a particular WebContents' PBM must outlive it. |
| 26 // | 26 // |
| 27 // The PermissionBubbleManager should be addressed on the UI thread. | 27 // The PermissionBubbleManager should be addressed on the UI thread. |
| 28 class PermissionBubbleManager | 28 class PermissionBubbleManager |
| 29 : public content::WebContentsObserver, | 29 : public content::WebContentsObserver, |
| 30 public content::WebContentsUserData<PermissionBubbleManager>, | 30 public content::WebContentsUserData<PermissionBubbleManager>, |
| 31 public PermissionBubbleView::Delegate { | 31 public PermissionBubbleView::Delegate { |
| 32 public: | 32 public: |
| 33 // Return the flag-driven enabled state of permissions bubbles. | 33 // Return the enabled state of permissions bubbles. |
| 34 // Controlled by a flag and FieldTrial. |
| 34 static bool Enabled(); | 35 static bool Enabled(); |
| 35 | 36 |
| 36 ~PermissionBubbleManager() override; | 37 ~PermissionBubbleManager() override; |
| 37 | 38 |
| 38 // Adds a new request to the permission bubble. Ownership of the request | 39 // Adds a new request to the permission bubble. Ownership of the request |
| 39 // remains with the caller. The caller must arrange for the request to | 40 // remains with the caller. The caller must arrange for the request to |
| 40 // outlive the PermissionBubbleManager. If a bubble is visible when this | 41 // outlive the PermissionBubbleManager. If a bubble is visible when this |
| 41 // call is made, the request will be queued up and shown after the current | 42 // call is made, the request will be queued up and shown after the current |
| 42 // bubble closes. A request with message text identical to an outstanding | 43 // bubble closes. A request with message text identical to an outstanding |
| 43 // request will receive a RequestFinished call immediately and not be added. | 44 // request will receive a RequestFinished call immediately and not be added. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 GURL request_url_; | 136 GURL request_url_; |
| 136 bool request_url_has_loaded_; | 137 bool request_url_has_loaded_; |
| 137 | 138 |
| 138 std::vector<bool> accept_states_; | 139 std::vector<bool> accept_states_; |
| 139 bool customization_mode_; | 140 bool customization_mode_; |
| 140 | 141 |
| 141 base::WeakPtrFactory<PermissionBubbleManager> weak_factory_; | 142 base::WeakPtrFactory<PermissionBubbleManager> weak_factory_; |
| 142 }; | 143 }; |
| 143 | 144 |
| 144 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ | 145 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ |
| OLD | NEW |