OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EXTENSION_SYSTEM_IMPL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "extensions/browser/extension_system.h" | 12 #include "extensions/browser/extension_system.h" |
13 #include "extensions/common/one_shot_event.h" | 13 #include "extensions/common/one_shot_event.h" |
14 | 14 |
15 class Profile; | 15 class Profile; |
16 class ValueStore; | 16 class ValueStore; |
17 | 17 |
| 18 namespace content { |
| 19 class ResourceContext; |
| 20 } |
| 21 |
18 namespace extensions { | 22 namespace extensions { |
19 | 23 |
20 class ExtensionSystemSharedFactory; | 24 class ExtensionSystemSharedFactory; |
21 class NavigationObserver; | 25 class NavigationObserver; |
22 class StateStoreNotificationObserver; | 26 class StateStoreNotificationObserver; |
23 class UninstallPingSender; | 27 class UninstallPingSender; |
24 class InstallGate; | 28 class InstallGate; |
25 class ValueStoreFactory; | 29 class ValueStoreFactory; |
26 class ValueStoreFactoryImpl; | 30 class ValueStoreFactoryImpl; |
27 | 31 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 const OneShotEvent& ready() const override; | 67 const OneShotEvent& ready() const override; |
64 ContentVerifier* content_verifier() override; // shared | 68 ContentVerifier* content_verifier() override; // shared |
65 std::unique_ptr<ExtensionSet> GetDependentExtensions( | 69 std::unique_ptr<ExtensionSet> GetDependentExtensions( |
66 const Extension* extension) override; | 70 const Extension* extension) override; |
67 void InstallUpdate(const std::string& extension_id, | 71 void InstallUpdate(const std::string& extension_id, |
68 const base::FilePath& temp_dir) override; | 72 const base::FilePath& temp_dir) override; |
69 | 73 |
70 private: | 74 private: |
71 friend class ExtensionSystemSharedFactory; | 75 friend class ExtensionSystemSharedFactory; |
72 | 76 |
| 77 // Helper functions to register and unregister extensions. These are invoked |
| 78 // on the IO thread. |
| 79 static void RegisterExtensionHelper(InfoMap* info_map, |
| 80 const Extension* extension, |
| 81 base::Time install_time, |
| 82 bool incognito_enabled, |
| 83 bool notifications_disabled, |
| 84 const content::ResourceContext* context); |
| 85 static void UnregisterExtensionHelper( |
| 86 InfoMap* info_map, |
| 87 const std::string& extension_id, |
| 88 const UnloadedExtensionInfo::Reason reason, |
| 89 const content::ResourceContext* context); |
| 90 |
73 // Owns the Extension-related systems that have a single instance | 91 // Owns the Extension-related systems that have a single instance |
74 // shared between normal and incognito profiles. | 92 // shared between normal and incognito profiles. |
75 class Shared : public KeyedService { | 93 class Shared : public KeyedService { |
76 public: | 94 public: |
77 explicit Shared(Profile* profile); | 95 explicit Shared(Profile* profile); |
78 ~Shared() override; | 96 ~Shared() override; |
79 | 97 |
80 // Initialization takes place in phases. | 98 // Initialization takes place in phases. |
81 virtual void InitPrefs(); | 99 virtual void InitPrefs(); |
82 // This must not be called until all the providers have been created. | 100 // This must not be called until all the providers have been created. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 Profile* profile_; | 161 Profile* profile_; |
144 | 162 |
145 Shared* shared_; | 163 Shared* shared_; |
146 | 164 |
147 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); | 165 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); |
148 }; | 166 }; |
149 | 167 |
150 } // namespace extensions | 168 } // namespace extensions |
151 | 169 |
152 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ | 170 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ |
OLD | NEW |