OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTROLLER_BASE_H_ | 5 #ifndef CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTROLLER_BASE_H_ |
6 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTROLLER_BASE_H_ | 6 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTROLLER_BASE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" | 10 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 } | 35 } |
36 | 36 |
37 // Functions implemented by derived classes: | 37 // Functions implemented by derived classes: |
38 | 38 |
39 // Control behavior when escape is pressed returning true if it was handled. | 39 // Control behavior when escape is pressed returning true if it was handled. |
40 virtual bool HandleUserPressedEscape() = 0; | 40 virtual bool HandleUserPressedEscape() = 0; |
41 | 41 |
42 // Called by Browser in response to call from ExclusiveAccessBubble. | 42 // Called by Browser in response to call from ExclusiveAccessBubble. |
43 virtual void ExitExclusiveAccessToPreviousState() = 0; | 43 virtual void ExitExclusiveAccessToPreviousState() = 0; |
44 | 44 |
45 // Called to indicate that the permission for this exclusive access has been | |
46 // granted if requested. Returns true if the exit bubble content should be | |
47 // updated. | |
48 virtual bool OnAcceptExclusiveAccessPermission() = 0; | |
49 | |
50 // Called to indicate that the permission for the exclusive access has been | |
51 // denied if requested. Returns true if the exit bubble content should be | |
52 // updated. | |
53 virtual bool OnDenyExclusiveAccessPermission() = 0; | |
54 | |
55 // Called by ExclusiveAccessManager in response to calls from Browser. | 45 // Called by ExclusiveAccessManager in response to calls from Browser. |
56 virtual void OnTabDeactivated(content::WebContents* web_contents); | 46 virtual void OnTabDeactivated(content::WebContents* web_contents); |
57 virtual void OnTabDetachedFromView(content::WebContents* web_contents); | 47 virtual void OnTabDetachedFromView(content::WebContents* web_contents); |
58 virtual void OnTabClosing(content::WebContents* web_contents); | 48 virtual void OnTabClosing(content::WebContents* web_contents); |
59 | 49 |
60 // Callbacks //////////////////////////////////////////////////////////////// | 50 // Callbacks //////////////////////////////////////////////////////////////// |
61 | 51 |
62 // content::NotificationObserver to detect page navigation and exit exclusive | 52 // content::NotificationObserver to detect page navigation and exit exclusive |
63 // access. | 53 // access. |
64 void Observe(int type, | 54 void Observe(int type, |
(...skipping 30 matching lines...) Expand all Loading... |
95 | 85 |
96 content::WebContents* tab_with_exclusive_access_ = nullptr; | 86 content::WebContents* tab_with_exclusive_access_ = nullptr; |
97 | 87 |
98 // The number of bubble re-shows for the current session (reset upon exiting). | 88 // The number of bubble re-shows for the current session (reset upon exiting). |
99 int bubble_reshow_count_ = 0; | 89 int bubble_reshow_count_ = 0; |
100 | 90 |
101 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessControllerBase); | 91 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessControllerBase); |
102 }; | 92 }; |
103 | 93 |
104 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTROLLER_BASE_H
_ | 94 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTROLLER_BASE_H
_ |
OLD | NEW |