Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: trunk/src/chrome/browser/extensions/chrome_extensions_browser_client.h

Issue 399153002: Revert 283678 "Refactor code that defers extension background pa..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_
6 #define CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_ 6 #define CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/browser/extensions/chrome_notification_observer.h" 14 #include "chrome/browser/extensions/chrome_notification_observer.h"
15 #include "extensions/browser/extensions_browser_client.h" 15 #include "extensions/browser/extensions_browser_client.h"
16 16
17 namespace base { 17 namespace base {
18 class CommandLine; 18 class CommandLine;
19 } 19 }
20 20
21 namespace content { 21 namespace content {
22 class BrowserContext; 22 class BrowserContext;
23 } 23 }
24 24
25 namespace extensions { 25 namespace extensions {
26 26
27 class ChromeComponentExtensionResourceManager; 27 class ChromeComponentExtensionResourceManager;
28 class ChromeExtensionsAPIClient; 28 class ChromeExtensionsAPIClient;
29 class ChromeProcessManagerDelegate;
30 class ContentSettingsPrefsObserver; 29 class ContentSettingsPrefsObserver;
31 30
32 // Implementation of extensions::BrowserClient for Chrome, which includes 31 // Implementation of extensions::BrowserClient for Chrome, which includes
33 // knowledge of Profiles, BrowserContexts and incognito. 32 // knowledge of Profiles, BrowserContexts and incognito.
34 // 33 //
35 // NOTE: Methods that do not require knowledge of browser concepts should be 34 // NOTE: Methods that do not require knowledge of browser concepts should be
36 // implemented in ChromeExtensionsClient even if they are only used in the 35 // implemented in ChromeExtensionsClient even if they are only used in the
37 // browser process (see chrome/common/extensions/chrome_extensions_client.h). 36 // browser process (see chrome/common/extensions/chrome_extensions_client.h).
38 class ChromeExtensionsBrowserClient : public ExtensionsBrowserClient { 37 class ChromeExtensionsBrowserClient : public ExtensionsBrowserClient {
39 public: 38 public:
(...skipping 30 matching lines...) Expand all
70 virtual bool AllowCrossRendererResourceLoad(net::URLRequest* request, 69 virtual bool AllowCrossRendererResourceLoad(net::URLRequest* request,
71 bool is_incognito, 70 bool is_incognito,
72 const Extension* extension, 71 const Extension* extension,
73 InfoMap* extension_info_map) 72 InfoMap* extension_info_map)
74 OVERRIDE; 73 OVERRIDE;
75 virtual PrefService* GetPrefServiceForContext( 74 virtual PrefService* GetPrefServiceForContext(
76 content::BrowserContext* context) OVERRIDE; 75 content::BrowserContext* context) OVERRIDE;
77 virtual void GetEarlyExtensionPrefsObservers( 76 virtual void GetEarlyExtensionPrefsObservers(
78 content::BrowserContext* context, 77 content::BrowserContext* context,
79 std::vector<ExtensionPrefsObserver*>* observers) const OVERRIDE; 78 std::vector<ExtensionPrefsObserver*>* observers) const OVERRIDE;
80 virtual ProcessManagerDelegate* GetProcessManagerDelegate() const OVERRIDE; 79 virtual bool DeferLoadingBackgroundHosts(
80 content::BrowserContext* context) const OVERRIDE;
81 virtual bool IsBackgroundPageAllowed(
82 content::BrowserContext* context) const OVERRIDE;
81 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() 83 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate()
82 OVERRIDE; 84 OVERRIDE;
83 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE; 85 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE;
84 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE; 86 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE;
85 virtual bool IsRunningInForcedAppMode() OVERRIDE; 87 virtual bool IsRunningInForcedAppMode() OVERRIDE;
86 virtual ApiActivityMonitor* GetApiActivityMonitor( 88 virtual ApiActivityMonitor* GetApiActivityMonitor(
87 content::BrowserContext* context) OVERRIDE; 89 content::BrowserContext* context) OVERRIDE;
88 virtual ExtensionSystemProvider* GetExtensionSystemFactory() OVERRIDE; 90 virtual ExtensionSystemProvider* GetExtensionSystemFactory() OVERRIDE;
89 virtual void RegisterExtensionFunctions( 91 virtual void RegisterExtensionFunctions(
90 ExtensionFunctionRegistry* registry) const OVERRIDE; 92 ExtensionFunctionRegistry* registry) const OVERRIDE;
91 virtual scoped_ptr<extensions::RuntimeAPIDelegate> CreateRuntimeAPIDelegate( 93 virtual scoped_ptr<extensions::RuntimeAPIDelegate> CreateRuntimeAPIDelegate(
92 content::BrowserContext* context) const OVERRIDE; 94 content::BrowserContext* context) const OVERRIDE;
93 virtual ComponentExtensionResourceManager* 95 virtual ComponentExtensionResourceManager*
94 GetComponentExtensionResourceManager() OVERRIDE; 96 GetComponentExtensionResourceManager() OVERRIDE;
95 97
96 private: 98 private:
97 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsBrowserClient>; 99 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsBrowserClient>;
98 100
99 // Observer for Chrome-specific notifications. 101 // Observer for Chrome-specific notifications.
100 ChromeNotificationObserver notification_observer_; 102 ChromeNotificationObserver notification_observer_;
101 103
102 #if defined(ENABLE_EXTENSIONS) 104 #if defined(ENABLE_EXTENSIONS)
103 // Support for ProcessManager.
104 scoped_ptr<ChromeProcessManagerDelegate> process_manager_delegate_;
105
106 // Client for API implementations. 105 // Client for API implementations.
107 scoped_ptr<ChromeExtensionsAPIClient> api_client_; 106 scoped_ptr<ChromeExtensionsAPIClient> api_client_;
108 #endif 107 #endif
109 108
110 scoped_ptr<ChromeComponentExtensionResourceManager> resource_manager_; 109 scoped_ptr<ChromeComponentExtensionResourceManager> resource_manager_;
111 110
112 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsBrowserClient); 111 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsBrowserClient);
113 }; 112 };
114 113
115 } // namespace extensions 114 } // namespace extensions
116 115
117 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_ 116 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698