OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ | 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ |
6 #define APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ | 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "extensions/browser/extensions_browser_client.h" | 9 #include "extensions/browser/extensions_browser_client.h" |
10 | 10 |
11 class PrefService; | 11 class PrefService; |
12 | 12 |
13 namespace extensions { | 13 namespace extensions { |
14 | 14 |
15 class ExtensionsAPIClient; | 15 class ExtensionsAPIClient; |
16 | 16 |
17 // An ExtensionsBrowserClient that supports a single content::BrowserContent | 17 // An ExtensionsBrowserClient that supports a single content::BrowserContent |
18 // with no related incognito context. | 18 // with no related incognito context. |
19 class ShellExtensionsBrowserClient : public ExtensionsBrowserClient { | 19 class ShellExtensionsBrowserClient : public ExtensionsBrowserClient { |
20 public: | 20 public: |
21 // |context| is the single BrowserContext used for IsValidContext() below. | 21 // |context| is the single BrowserContext used for IsValidContext() below. |
22 explicit ShellExtensionsBrowserClient(content::BrowserContext* context); | 22 explicit ShellExtensionsBrowserClient(content::BrowserContext* context); |
23 virtual ~ShellExtensionsBrowserClient(); | 23 virtual ~ShellExtensionsBrowserClient(); |
24 | 24 |
25 // ExtensionsBrowserClient overrides: | 25 // ExtensionsBrowserClient overrides: |
26 virtual bool IsShuttingDown() OVERRIDE; | 26 virtual bool IsShuttingDown() OVERRIDE; |
27 virtual bool AreExtensionsDisabled(const base::CommandLine& command_line, | 27 virtual bool AreExtensionsDisabled(const base::CommandLine& command_line, |
28 content::BrowserContext* context) OVERRIDE; | 28 content::BrowserContext* context) OVERRIDE; |
29 virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; | 29 virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; |
30 virtual bool IsSameContext(content::BrowserContext* first, | 30 virtual bool IsSameContext(content::BrowserContext* first, |
31 content::BrowserContext* second) OVERRIDE; | 31 content::BrowserContext* second) OVERRIDE; |
32 virtual bool HasOffTheRecordContext(content::BrowserContext* context) | 32 virtual bool HasOffTheRecordContext( |
33 OVERRIDE; | 33 content::BrowserContext* context) OVERRIDE; |
34 virtual content::BrowserContext* GetOffTheRecordContext( | 34 virtual content::BrowserContext* GetOffTheRecordContext( |
35 content::BrowserContext* context) OVERRIDE; | 35 content::BrowserContext* context) OVERRIDE; |
36 virtual content::BrowserContext* GetOriginalContext( | 36 virtual content::BrowserContext* GetOriginalContext( |
37 content::BrowserContext* context) OVERRIDE; | 37 content::BrowserContext* context) OVERRIDE; |
38 virtual bool IsGuestSession(content::BrowserContext* context) const OVERRIDE; | 38 virtual bool IsGuestSession(content::BrowserContext* context) const OVERRIDE; |
39 virtual bool IsExtensionIncognitoEnabled( | 39 virtual bool IsExtensionIncognitoEnabled( |
40 const std::string& extension_id, | 40 const std::string& extension_id, |
41 content::BrowserContext* context) const OVERRIDE; | 41 content::BrowserContext* context) const OVERRIDE; |
42 virtual bool CanExtensionCrossIncognito( | 42 virtual bool CanExtensionCrossIncognito( |
43 const extensions::Extension* extension, | 43 const Extension* extension, |
44 content::BrowserContext* context) const OVERRIDE; | 44 content::BrowserContext* context) const OVERRIDE; |
45 virtual bool IsWebViewRequest(net::URLRequest* request) const OVERRIDE; | 45 virtual bool IsWebViewRequest(net::URLRequest* request) const OVERRIDE; |
46 virtual net::URLRequestJob* MaybeCreateResourceBundleRequestJob( | 46 virtual net::URLRequestJob* MaybeCreateResourceBundleRequestJob( |
47 net::URLRequest* request, | 47 net::URLRequest* request, |
48 net::NetworkDelegate* network_delegate, | 48 net::NetworkDelegate* network_delegate, |
49 const base::FilePath& directory_path, | 49 const base::FilePath& directory_path, |
50 const std::string& content_security_policy, | 50 const std::string& content_security_policy, |
51 bool send_cors_header) OVERRIDE; | 51 bool send_cors_header) OVERRIDE; |
52 virtual bool AllowCrossRendererResourceLoad(net::URLRequest* request, | 52 virtual bool AllowCrossRendererResourceLoad( |
53 bool is_incognito, | 53 net::URLRequest* request, |
54 const Extension* extension, | 54 bool is_incognito, |
55 InfoMap* extension_info_map) | 55 const Extension* extension, |
56 OVERRIDE; | 56 InfoMap* extension_info_map) OVERRIDE; |
57 virtual PrefService* GetPrefServiceForContext( | 57 virtual PrefService* GetPrefServiceForContext( |
58 content::BrowserContext* context) OVERRIDE; | 58 content::BrowserContext* context) OVERRIDE; |
59 virtual void GetEarlyExtensionPrefsObservers( | 59 virtual void GetEarlyExtensionPrefsObservers( |
60 content::BrowserContext* context, | 60 content::BrowserContext* context, |
61 std::vector<ExtensionPrefsObserver*>* observers) const OVERRIDE; | 61 std::vector<ExtensionPrefsObserver*>* observers) const OVERRIDE; |
62 virtual ProcessManagerDelegate* GetProcessManagerDelegate() const OVERRIDE; | 62 virtual ProcessManagerDelegate* GetProcessManagerDelegate() const OVERRIDE; |
63 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() | 63 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() |
64 OVERRIDE; | 64 OVERRIDE; |
65 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE; | 65 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE; |
66 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE; | 66 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE; |
67 virtual bool IsRunningInForcedAppMode() OVERRIDE; | 67 virtual bool IsRunningInForcedAppMode() OVERRIDE; |
68 virtual ApiActivityMonitor* GetApiActivityMonitor( | 68 virtual ApiActivityMonitor* GetApiActivityMonitor( |
69 content::BrowserContext* context) OVERRIDE; | 69 content::BrowserContext* context) OVERRIDE; |
70 virtual ExtensionSystemProvider* GetExtensionSystemFactory() OVERRIDE; | 70 virtual ExtensionSystemProvider* GetExtensionSystemFactory() OVERRIDE; |
71 virtual void RegisterExtensionFunctions( | 71 virtual void RegisterExtensionFunctions( |
72 ExtensionFunctionRegistry* registry) const OVERRIDE; | 72 ExtensionFunctionRegistry* registry) const OVERRIDE; |
73 virtual scoped_ptr<RuntimeAPIDelegate> CreateRuntimeAPIDelegate( | 73 virtual scoped_ptr<RuntimeAPIDelegate> CreateRuntimeAPIDelegate( |
74 content::BrowserContext* context) const OVERRIDE; | 74 content::BrowserContext* context) const OVERRIDE; |
75 virtual ComponentExtensionResourceManager* | 75 virtual ComponentExtensionResourceManager* |
76 GetComponentExtensionResourceManager() OVERRIDE; | 76 GetComponentExtensionResourceManager() OVERRIDE; |
77 | 77 |
78 private: | 78 private: |
79 // The single BrowserContext for app_shell. Not owned. | 79 // The single BrowserContext for app_shell. Not owned. |
80 content::BrowserContext* browser_context_; | 80 content::BrowserContext* browser_context_; |
81 | 81 |
82 // Support for extension APIs. | 82 // Support for extension APIs. |
83 scoped_ptr<ExtensionsAPIClient> api_client_; | 83 scoped_ptr<ExtensionsAPIClient> api_client_; |
84 | 84 |
85 // The PrefService for |browser_context_|. | 85 // The PrefService for |browser_context_|. |
86 scoped_ptr<PrefService> prefs_; | 86 scoped_ptr<PrefService> prefs_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(ShellExtensionsBrowserClient); | 88 DISALLOW_COPY_AND_ASSIGN(ShellExtensionsBrowserClient); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace extensions | 91 } // namespace extensions |
92 | 92 |
93 #endif // APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ | 93 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ |
OLD | NEW |