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 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/extensions/chrome_notification_observer.h" | 12 #include "chrome/browser/extensions/chrome_notification_observer.h" |
13 #include "extensions/browser/extensions_browser_client.h" | 13 #include "extensions/browser/extensions_browser_client.h" |
14 | 14 |
| 15 class CommandLine; |
| 16 |
15 namespace content { | 17 namespace content { |
16 class BrowserContext; | 18 class BrowserContext; |
17 } | 19 } |
18 | 20 |
19 namespace extensions { | 21 namespace extensions { |
20 | 22 |
21 // Implementation of extensions::BrowserClient for Chrome, which includes | 23 // Implementation of extensions::BrowserClient for Chrome, which includes |
22 // knowledge of Profiles, BrowserContexts and incognito. | 24 // knowledge of Profiles, BrowserContexts and incognito. |
23 // | 25 // |
24 // NOTE: Methods that do not require knowledge of browser concepts should be | 26 // NOTE: Methods that do not require knowledge of browser concepts should be |
25 // implemented in ChromeExtensionsClient even if they are only used in the | 27 // implemented in ChromeExtensionsClient even if they are only used in the |
26 // browser process (see chrome/common/extensions/chrome_extensions_client.h). | 28 // browser process (see chrome/common/extensions/chrome_extensions_client.h). |
27 class ChromeExtensionsBrowserClient : public ExtensionsBrowserClient { | 29 class ChromeExtensionsBrowserClient : public ExtensionsBrowserClient { |
28 public: | 30 public: |
29 ChromeExtensionsBrowserClient(); | 31 ChromeExtensionsBrowserClient(); |
30 virtual ~ChromeExtensionsBrowserClient(); | 32 virtual ~ChromeExtensionsBrowserClient(); |
31 | 33 |
32 // BrowserClient overrides: | 34 // BrowserClient overrides: |
33 virtual bool IsShuttingDown() OVERRIDE; | 35 virtual bool IsShuttingDown() OVERRIDE; |
| 36 virtual bool AreExtensionsDisabled(const CommandLine& command_line, |
| 37 content::BrowserContext* context) OVERRIDE; |
34 virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; | 38 virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; |
35 virtual bool IsSameContext(content::BrowserContext* first, | 39 virtual bool IsSameContext(content::BrowserContext* first, |
36 content::BrowserContext* second) OVERRIDE; | 40 content::BrowserContext* second) OVERRIDE; |
37 virtual bool HasOffTheRecordContext( | 41 virtual bool HasOffTheRecordContext( |
38 content::BrowserContext* context) OVERRIDE; | 42 content::BrowserContext* context) OVERRIDE; |
39 virtual content::BrowserContext* GetOffTheRecordContext( | 43 virtual content::BrowserContext* GetOffTheRecordContext( |
40 content::BrowserContext* context) OVERRIDE; | 44 content::BrowserContext* context) OVERRIDE; |
41 virtual content::BrowserContext* GetOriginalContext( | 45 virtual content::BrowserContext* GetOriginalContext( |
42 content::BrowserContext* context) OVERRIDE; | 46 content::BrowserContext* context) OVERRIDE; |
| 47 virtual PrefService* GetPrefServiceForContext( |
| 48 content::BrowserContext* context) OVERRIDE; |
43 virtual bool DeferLoadingBackgroundHosts( | 49 virtual bool DeferLoadingBackgroundHosts( |
44 content::BrowserContext* context) const OVERRIDE; | 50 content::BrowserContext* context) const OVERRIDE; |
45 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE; | 51 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE; |
46 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE; | 52 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE; |
47 virtual bool IsRunningInForcedAppMode() OVERRIDE; | 53 virtual bool IsRunningInForcedAppMode() OVERRIDE; |
48 | 54 |
49 // Get the LazyInstance for ChromeBrowserClient. | 55 // Get the LazyInstance for ChromeBrowserClient. |
50 static ChromeExtensionsBrowserClient* GetInstance(); | 56 static ChromeExtensionsBrowserClient* GetInstance(); |
51 | 57 |
52 private: | 58 private: |
53 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsBrowserClient>; | 59 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsBrowserClient>; |
54 | 60 |
55 // Observer for Chrome-specific notifications. | 61 // Observer for Chrome-specific notifications. |
56 ChromeNotificationObserver notification_observer_; | 62 ChromeNotificationObserver notification_observer_; |
57 | 63 |
58 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsBrowserClient); | 64 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsBrowserClient); |
59 }; | 65 }; |
60 | 66 |
61 } // namespace extensions | 67 } // namespace extensions |
62 | 68 |
63 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_ | 69 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_ |
OLD | NEW |