OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 private: | 47 private: |
48 // content::WebContentsObserver implementation. | 48 // content::WebContentsObserver implementation. |
49 void DidFinishNavigation( | 49 void DidFinishNavigation( |
50 content::NavigationHandle* navigation_handle) override; | 50 content::NavigationHandle* navigation_handle) override; |
51 void WebContentsDestroyed() override; | 51 void WebContentsDestroyed() override; |
52 | 52 |
53 // extensions::ExtensionRegistryObserver implementation. | 53 // extensions::ExtensionRegistryObserver implementation. |
54 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 54 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
55 const Extension* extension, | 55 const Extension* extension, |
56 UnloadedExtensionInfo::Reason reason) override; | 56 UnloadedExtensionReason reason) override; |
57 | 57 |
58 // Clears any tab-specific permissions for all extensions on |tab_id_| and | 58 // Clears any tab-specific permissions for all extensions on |tab_id_| and |
59 // notifies renderers. | 59 // notifies renderers. |
60 void ClearActiveExtensionsAndNotify(); | 60 void ClearActiveExtensionsAndNotify(); |
61 | 61 |
62 // The tab ID for this tab. | 62 // The tab ID for this tab. |
63 int tab_id_; | 63 int tab_id_; |
64 | 64 |
65 // Extensions with the activeTab permission that have been granted | 65 // Extensions with the activeTab permission that have been granted |
66 // tab-specific permissions until the next navigation/refresh. | 66 // tab-specific permissions until the next navigation/refresh. |
67 ExtensionSet granted_extensions_; | 67 ExtensionSet granted_extensions_; |
68 | 68 |
69 // Listen to extension unloaded notifications. | 69 // Listen to extension unloaded notifications. |
70 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 70 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
71 extension_registry_observer_; | 71 extension_registry_observer_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(ActiveTabPermissionGranter); | 73 DISALLOW_COPY_AND_ASSIGN(ActiveTabPermissionGranter); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace extensions | 76 } // namespace extensions |
77 | 77 |
78 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_ | 78 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_ |
OLD | NEW |