| 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 EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 | 11 |
| 12 class BrowserContextKeyedServiceFactory; | 12 class BrowserContextKeyedServiceFactory; |
| 13 class CommandLine; | 13 class CommandLine; |
| 14 class PrefService; | 14 class PrefService; |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class BrowserContext; | 17 class BrowserContext; |
| 18 class JavaScriptDialogManager; | 18 class JavaScriptDialogManager; |
| 19 class WebContents; | 19 class WebContents; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 | 23 |
| 24 class ApiActivityMonitor; |
| 24 class AppSorting; | 25 class AppSorting; |
| 25 class ExtensionSystem; | 26 class ExtensionSystem; |
| 26 | 27 |
| 27 // Interface to allow the extensions module to make browser-process-specific | 28 // Interface to allow the extensions module to make browser-process-specific |
| 28 // queries of the embedder. Should be Set() once in the browser process. | 29 // queries of the embedder. Should be Set() once in the browser process. |
| 29 // | 30 // |
| 30 // NOTE: Methods that do not require knowledge of browser concepts should be | 31 // NOTE: Methods that do not require knowledge of browser concepts should be |
| 31 // added in ExtensionsClient (extensions/common/extensions_client.h) even if | 32 // added in ExtensionsClient (extensions/common/extensions_client.h) even if |
| 32 // they are only used in the browser process. | 33 // they are only used in the browser process. |
| 33 class ExtensionsBrowserClient { | 34 class ExtensionsBrowserClient { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Creates a new AppSorting instance. | 90 // Creates a new AppSorting instance. |
| 90 virtual scoped_ptr<AppSorting> CreateAppSorting() = 0; | 91 virtual scoped_ptr<AppSorting> CreateAppSorting() = 0; |
| 91 | 92 |
| 92 // Return true if the system is run in forced app mode. | 93 // Return true if the system is run in forced app mode. |
| 93 virtual bool IsRunningInForcedAppMode() = 0; | 94 virtual bool IsRunningInForcedAppMode() = 0; |
| 94 | 95 |
| 95 // Returns the embedder's JavaScriptDialogManager or NULL if the embedder | 96 // Returns the embedder's JavaScriptDialogManager or NULL if the embedder |
| 96 // does not support JavaScript dialogs. | 97 // does not support JavaScript dialogs. |
| 97 virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager() = 0; | 98 virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager() = 0; |
| 98 | 99 |
| 100 // Returns the embedder's ApiActivityMonitor for |context|. Returns NULL if |
| 101 // the embedder does not monitor extension API activity. |
| 102 virtual ApiActivityMonitor* GetApiActivityMonitor( |
| 103 content::BrowserContext* context) = 0; |
| 104 |
| 99 // Returns the dependencies of ExtensionSystem. May return an empty list. | 105 // Returns the dependencies of ExtensionSystem. May return an empty list. |
| 100 virtual std::vector<BrowserContextKeyedServiceFactory*> | 106 virtual std::vector<BrowserContextKeyedServiceFactory*> |
| 101 GetExtensionSystemDependencies() = 0; | 107 GetExtensionSystemDependencies() = 0; |
| 102 | 108 |
| 103 // Creates a new ExtensionSystem for |context|. | 109 // Creates a new ExtensionSystem for |context|. |
| 104 virtual ExtensionSystem* CreateExtensionSystem( | 110 virtual ExtensionSystem* CreateExtensionSystem( |
| 105 content::BrowserContext* context) = 0; | 111 content::BrowserContext* context) = 0; |
| 106 | 112 |
| 107 // Returns the single instance of |this|. | 113 // Returns the single instance of |this|. |
| 108 static ExtensionsBrowserClient* Get(); | 114 static ExtensionsBrowserClient* Get(); |
| 109 | 115 |
| 110 // Initialize the single instance. | 116 // Initialize the single instance. |
| 111 static void Set(ExtensionsBrowserClient* client); | 117 static void Set(ExtensionsBrowserClient* client); |
| 112 }; | 118 }; |
| 113 | 119 |
| 114 } // namespace extensions | 120 } // namespace extensions |
| 115 | 121 |
| 116 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ | 122 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ |
| OLD | NEW |