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_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_VIEW_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 class Browser; |
10 class PermissionBubbleRequest; | 11 class PermissionBubbleRequest; |
11 class PermissionBubbleManager; | 12 class PermissionBubbleManager; |
12 | 13 |
13 // This class is the platform-independent interface through which the permission | 14 // This class is the platform-independent interface through which the permission |
14 // bubble managers (which are one per tab) communicate to the UI surface. | 15 // bubble managers (which are one per tab) communicate to the UI surface. |
15 // When the visible tab changes, the UI code must provide an object of this type | 16 // When the visible tab changes, the UI code must provide an object of this type |
16 // to the manager for the visible tab. | 17 // to the manager for the visible tab. |
17 class PermissionBubbleView { | 18 class PermissionBubbleView { |
18 public: | 19 public: |
| 20 // Creates the platform-specific PermissionBubbleView. Implemented by |
| 21 // per-platform code. |
| 22 static PermissionBubbleView* Create(Browser* Browser); |
| 23 |
19 // The delegate will receive events caused by user action which need to | 24 // The delegate will receive events caused by user action which need to |
20 // be persisted in the per-tab UI state. | 25 // be persisted in the per-tab UI state. |
21 class Delegate { | 26 class Delegate { |
22 public: | 27 public: |
23 virtual ~Delegate() {} | 28 virtual ~Delegate() {} |
24 | 29 |
25 virtual void ToggleAccept(int index, bool new_value) = 0; | 30 virtual void ToggleAccept(int index, bool new_value) = 0; |
26 virtual void Accept() = 0; | 31 virtual void Accept() = 0; |
27 virtual void Deny() = 0; | 32 virtual void Deny() = 0; |
28 virtual void Closing() = 0; | 33 virtual void Closing() = 0; |
(...skipping 21 matching lines...) Expand all Loading... |
50 virtual bool CanAcceptRequestUpdate() = 0; | 55 virtual bool CanAcceptRequestUpdate() = 0; |
51 | 56 |
52 // Hides the permission bubble. | 57 // Hides the permission bubble. |
53 virtual void Hide() = 0; | 58 virtual void Hide() = 0; |
54 | 59 |
55 // Returns true if there is a bubble currently showing. | 60 // Returns true if there is a bubble currently showing. |
56 virtual bool IsVisible() = 0; | 61 virtual bool IsVisible() = 0; |
57 }; | 62 }; |
58 | 63 |
59 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_VIEW_H_ | 64 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_VIEW_H_ |
OLD | NEW |