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 "base/memory/scoped_ptr.h" |
| 9 |
8 namespace content { | 10 namespace content { |
9 class BrowserContext; | 11 class BrowserContext; |
10 } | 12 } |
11 | 13 |
12 namespace extensions { | 14 namespace extensions { |
13 | 15 |
| 16 class AppSorting; |
| 17 |
14 // Interface to allow the extensions module to make browser-process-specific | 18 // Interface to allow the extensions module to make browser-process-specific |
15 // queries of the embedder. Should be Set() once in the browser process. | 19 // queries of the embedder. Should be Set() once in the browser process. |
16 // | 20 // |
17 // NOTE: Methods that do not require knowledge of browser concepts should be | 21 // NOTE: Methods that do not require knowledge of browser concepts should be |
18 // added in ExtensionsClient (extensions/common/extensions_client.h) even if | 22 // added in ExtensionsClient (extensions/common/extensions_client.h) even if |
19 // they are only used in the browser process. | 23 // they are only used in the browser process. |
20 class ExtensionsBrowserClient { | 24 class ExtensionsBrowserClient { |
21 public: | 25 public: |
22 virtual ~ExtensionsBrowserClient() {} | 26 virtual ~ExtensionsBrowserClient() {} |
23 | 27 |
(...skipping 26 matching lines...) Expand all Loading... |
50 // Returns true if loading background pages should be deferred. | 54 // Returns true if loading background pages should be deferred. |
51 virtual bool DeferLoadingBackgroundHosts( | 55 virtual bool DeferLoadingBackgroundHosts( |
52 content::BrowserContext* context) const = 0; | 56 content::BrowserContext* context) const = 0; |
53 | 57 |
54 // Returns true if the client version has updated since the last run. Called | 58 // Returns true if the client version has updated since the last run. Called |
55 // once each time the extensions system is loaded per browser_context. The | 59 // once each time the extensions system is loaded per browser_context. The |
56 // implementation may wish to use the BrowserContext to record the current | 60 // implementation may wish to use the BrowserContext to record the current |
57 // version for later comparison. | 61 // version for later comparison. |
58 virtual bool DidVersionUpdate(content::BrowserContext* context) = 0; | 62 virtual bool DidVersionUpdate(content::BrowserContext* context) = 0; |
59 | 63 |
| 64 // Creates a new AppSorting instance. |
| 65 virtual scoped_ptr<AppSorting> CreateAppSorting() = 0; |
| 66 |
60 // Returns the single instance of |this|. | 67 // Returns the single instance of |this|. |
61 static ExtensionsBrowserClient* Get(); | 68 static ExtensionsBrowserClient* Get(); |
62 | 69 |
63 // Initialize the single instance. | 70 // Initialize the single instance. |
64 static void Set(ExtensionsBrowserClient* client); | 71 static void Set(ExtensionsBrowserClient* client); |
65 }; | 72 }; |
66 | 73 |
67 } // namespace extensions | 74 } // namespace extensions |
68 | 75 |
69 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ | 76 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ |
OLD | NEW |