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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // removed and never shown. If the request is showing, it will continue to be | 48 // removed and never shown. If the request is showing, it will continue to be |
49 // shown, but the user's action won't be reported back to the request object. | 49 // shown, but the user's action won't be reported back to the request object. |
50 // In some circumstances, we can remove the request from the bubble, and may | 50 // In some circumstances, we can remove the request from the bubble, and may |
51 // do so. The request will have RequestFinished executed on it if it is found, | 51 // do so. The request will have RequestFinished executed on it if it is found, |
52 // at which time the caller is free to delete the request. | 52 // at which time the caller is free to delete the request. |
53 virtual void CancelRequest(PermissionBubbleRequest* request); | 53 virtual void CancelRequest(PermissionBubbleRequest* request); |
54 | 54 |
55 // Sets the active view for the permission bubble. If this is NULL, it | 55 // Sets the active view for the permission bubble. If this is NULL, it |
56 // means any existing permission bubble can no longer be shown. Does not | 56 // means any existing permission bubble can no longer be shown. Does not |
57 // take ownership of the view. | 57 // take ownership of the view. |
58 virtual void SetView(PermissionBubbleView* view) OVERRIDE; | 58 virtual void SetView(PermissionBubbleView* view) override; |
59 | 59 |
60 private: | 60 private: |
61 friend class PermissionBubbleManagerTest; | 61 friend class PermissionBubbleManagerTest; |
62 friend class DownloadRequestLimiterTest; | 62 friend class DownloadRequestLimiterTest; |
63 friend class content::WebContentsUserData<PermissionBubbleManager>; | 63 friend class content::WebContentsUserData<PermissionBubbleManager>; |
64 | 64 |
65 explicit PermissionBubbleManager(content::WebContents* web_contents); | 65 explicit PermissionBubbleManager(content::WebContents* web_contents); |
66 | 66 |
67 // WebContentsObserver: | 67 // WebContentsObserver: |
68 virtual void DocumentOnLoadCompletedInMainFrame() OVERRIDE; | 68 virtual void DocumentOnLoadCompletedInMainFrame() override; |
69 virtual void DocumentLoadedInFrame( | 69 virtual void DocumentLoadedInFrame( |
70 content::RenderFrameHost* render_frame_host) OVERRIDE; | 70 content::RenderFrameHost* render_frame_host) override; |
71 | 71 |
72 // If a page on which permissions requests are pending is navigated, | 72 // If a page on which permissions requests are pending is navigated, |
73 // they will be finalized as if canceled by the user. | 73 // they will be finalized as if canceled by the user. |
74 virtual void NavigationEntryCommitted( | 74 virtual void NavigationEntryCommitted( |
75 const content::LoadCommittedDetails& details) OVERRIDE; | 75 const content::LoadCommittedDetails& details) override; |
76 virtual void WebContentsDestroyed() OVERRIDE; | 76 virtual void WebContentsDestroyed() override; |
77 | 77 |
78 // PermissionBubbleView::Delegate: | 78 // PermissionBubbleView::Delegate: |
79 virtual void ToggleAccept(int request_index, bool new_value) OVERRIDE; | 79 virtual void ToggleAccept(int request_index, bool new_value) override; |
80 virtual void SetCustomizationMode() OVERRIDE; | 80 virtual void SetCustomizationMode() override; |
81 virtual void Accept() OVERRIDE; | 81 virtual void Accept() override; |
82 virtual void Deny() OVERRIDE; | 82 virtual void Deny() override; |
83 virtual void Closing() OVERRIDE; | 83 virtual void Closing() override; |
84 | 84 |
85 // Posts a task which will allow the bubble to become visible if it is needed. | 85 // Posts a task which will allow the bubble to become visible if it is needed. |
86 void ScheduleShowBubble(); | 86 void ScheduleShowBubble(); |
87 | 87 |
88 // Shows the bubble if it is not already visible and there are pending | 88 // Shows the bubble if it is not already visible and there are pending |
89 // requests. | 89 // requests. |
90 void TriggerShowBubble(); | 90 void TriggerShowBubble(); |
91 | 91 |
92 // Finalize the pending permissions request. | 92 // Finalize the pending permissions request. |
93 void FinalizeBubble(); | 93 void FinalizeBubble(); |
(...skipping 30 matching lines...) Expand all Loading... |
124 GURL request_url_; | 124 GURL request_url_; |
125 bool request_url_has_loaded_; | 125 bool request_url_has_loaded_; |
126 | 126 |
127 std::vector<bool> accept_states_; | 127 std::vector<bool> accept_states_; |
128 bool customization_mode_; | 128 bool customization_mode_; |
129 | 129 |
130 base::WeakPtrFactory<PermissionBubbleManager> weak_factory_; | 130 base::WeakPtrFactory<PermissionBubbleManager> weak_factory_; |
131 }; | 131 }; |
132 | 132 |
133 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ | 133 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ |
OLD | NEW |