| 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_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ | 5 #ifndef APPS_SHELL_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ |
| 6 #define APPS_SHELL_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ | 6 #define APPS_SHELL_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 apps { | 13 namespace extensions { |
| 14 | 14 |
| 15 // An ExtensionsBrowserClient that supports a single content::BrowserContent | 15 // An ExtensionsBrowserClient that supports a single content::BrowserContent |
| 16 // with no related incognito context. | 16 // with no related incognito context. |
| 17 class ShellExtensionsBrowserClient | 17 class ShellExtensionsBrowserClient : public ExtensionsBrowserClient { |
| 18 : public extensions::ExtensionsBrowserClient { | |
| 19 public: | 18 public: |
| 20 // |context| is the single BrowserContext used for IsValidContext() below. | 19 // |context| is the single BrowserContext used for IsValidContext() below. |
| 21 explicit ShellExtensionsBrowserClient(content::BrowserContext* context); | 20 explicit ShellExtensionsBrowserClient(content::BrowserContext* context); |
| 22 virtual ~ShellExtensionsBrowserClient(); | 21 virtual ~ShellExtensionsBrowserClient(); |
| 23 | 22 |
| 24 // extensions::ExtensionsBrowserClient overrides: | 23 // ExtensionsBrowserClient overrides: |
| 25 virtual bool IsShuttingDown() OVERRIDE; | 24 virtual bool IsShuttingDown() OVERRIDE; |
| 26 virtual bool AreExtensionsDisabled(const CommandLine& command_line, | 25 virtual bool AreExtensionsDisabled(const CommandLine& command_line, |
| 27 content::BrowserContext* context) OVERRIDE; | 26 content::BrowserContext* context) OVERRIDE; |
| 28 virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; | 27 virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; |
| 29 virtual bool IsSameContext(content::BrowserContext* first, | 28 virtual bool IsSameContext(content::BrowserContext* first, |
| 30 content::BrowserContext* second) OVERRIDE; | 29 content::BrowserContext* second) OVERRIDE; |
| 31 virtual bool HasOffTheRecordContext(content::BrowserContext* context) | 30 virtual bool HasOffTheRecordContext(content::BrowserContext* context) |
| 32 OVERRIDE; | 31 OVERRIDE; |
| 33 virtual content::BrowserContext* GetOffTheRecordContext( | 32 virtual content::BrowserContext* GetOffTheRecordContext( |
| 34 content::BrowserContext* context) OVERRIDE; | 33 content::BrowserContext* context) OVERRIDE; |
| 35 virtual content::BrowserContext* GetOriginalContext( | 34 virtual content::BrowserContext* GetOriginalContext( |
| 36 content::BrowserContext* context) OVERRIDE; | 35 content::BrowserContext* context) OVERRIDE; |
| 37 virtual PrefService* GetPrefServiceForContext( | 36 virtual PrefService* GetPrefServiceForContext( |
| 38 content::BrowserContext* context) OVERRIDE; | 37 content::BrowserContext* context) OVERRIDE; |
| 39 virtual bool DeferLoadingBackgroundHosts(content::BrowserContext* context) | 38 virtual bool DeferLoadingBackgroundHosts(content::BrowserContext* context) |
| 40 const OVERRIDE; | 39 const OVERRIDE; |
| 41 virtual bool IsBackgroundPageAllowed(content::BrowserContext* context) | 40 virtual bool IsBackgroundPageAllowed(content::BrowserContext* context) |
| 42 const OVERRIDE; | 41 const OVERRIDE; |
| 43 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE; | 42 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE; |
| 44 virtual scoped_ptr<extensions::AppSorting> CreateAppSorting() OVERRIDE; | 43 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE; |
| 45 virtual bool IsRunningInForcedAppMode() OVERRIDE; | 44 virtual bool IsRunningInForcedAppMode() OVERRIDE; |
| 46 virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager() | 45 virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager() |
| 47 OVERRIDE; | 46 OVERRIDE; |
| 47 virtual std::vector<BrowserContextKeyedServiceFactory*> |
| 48 GetExtensionSystemDependencies() OVERRIDE; |
| 49 virtual ExtensionSystem* CreateExtensionSystem( |
| 50 content::BrowserContext* context) OVERRIDE; |
| 48 | 51 |
| 49 private: | 52 private: |
| 50 // The single BrowserContext for app_shell. Not owned. | 53 // The single BrowserContext for app_shell. Not owned. |
| 51 content::BrowserContext* browser_context_; | 54 content::BrowserContext* browser_context_; |
| 52 | 55 |
| 53 // The PrefService for |browser_context_|. | 56 // The PrefService for |browser_context_|. |
| 54 scoped_ptr<PrefService> prefs_; | 57 scoped_ptr<PrefService> prefs_; |
| 55 | 58 |
| 56 DISALLOW_COPY_AND_ASSIGN(ShellExtensionsBrowserClient); | 59 DISALLOW_COPY_AND_ASSIGN(ShellExtensionsBrowserClient); |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 } // namespace apps | 62 } // namespace extensions |
| 60 | 63 |
| 61 #endif // APPS_SHELL_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ | 64 #endif // APPS_SHELL_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ |
| OLD | NEW |