OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
19 #include "chrome/browser/extensions/blacklist.h" | 19 #include "chrome/browser/extensions/blacklist.h" |
20 #include "chrome/browser/extensions/extension_management.h" | 20 #include "chrome/browser/extensions/extension_management.h" |
21 #include "chrome/browser/extensions/pending_extension_manager.h" | 21 #include "chrome/browser/extensions/pending_extension_manager.h" |
22 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
23 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
| 24 #include "extensions/browser/crx_file_info.h" |
24 #include "extensions/browser/external_provider_interface.h" | 25 #include "extensions/browser/external_provider_interface.h" |
25 #include "extensions/browser/install_flag.h" | 26 #include "extensions/browser/install_flag.h" |
26 #include "extensions/browser/management_policy.h" | 27 #include "extensions/browser/management_policy.h" |
27 #include "extensions/browser/process_manager.h" | 28 #include "extensions/browser/process_manager.h" |
28 #include "extensions/browser/uninstall_reason.h" | 29 #include "extensions/browser/uninstall_reason.h" |
29 #include "extensions/common/extension.h" | 30 #include "extensions/common/extension.h" |
30 #include "extensions/common/extension_set.h" | 31 #include "extensions/common/extension_set.h" |
31 #include "extensions/common/manifest.h" | 32 #include "extensions/common/manifest.h" |
32 #include "sync/api/string_ordinal.h" | 33 #include "sync/api/string_ordinal.h" |
33 | 34 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 77 |
77 // Gets the object managing the set of pending extensions. | 78 // Gets the object managing the set of pending extensions. |
78 virtual extensions::PendingExtensionManager* pending_extension_manager() = 0; | 79 virtual extensions::PendingExtensionManager* pending_extension_manager() = 0; |
79 | 80 |
80 // Installs an update with the contents from |extension_path|. Returns true if | 81 // Installs an update with the contents from |extension_path|. Returns true if |
81 // the install can be started. Sets |out_crx_installer| to the installer if | 82 // the install can be started. Sets |out_crx_installer| to the installer if |
82 // one was started. | 83 // one was started. |
83 // TODO(aa): This method can be removed. ExtensionUpdater could use | 84 // TODO(aa): This method can be removed. ExtensionUpdater could use |
84 // CrxInstaller directly instead. | 85 // CrxInstaller directly instead. |
85 virtual bool UpdateExtension( | 86 virtual bool UpdateExtension( |
86 const std::string& id, | 87 const extensions::CRXFileInfo& file, |
87 const base::FilePath& path, | |
88 bool file_ownership_passed, | 88 bool file_ownership_passed, |
89 extensions::CrxInstaller** out_crx_installer) = 0; | 89 extensions::CrxInstaller** out_crx_installer) = 0; |
90 | 90 |
91 // DEPRECATED. Use ExtensionRegistry instead. | 91 // DEPRECATED. Use ExtensionRegistry instead. |
92 // | 92 // |
93 // Looks up an extension by its ID. | 93 // Looks up an extension by its ID. |
94 // | 94 // |
95 // If |include_disabled| is false then this will only include enabled | 95 // If |include_disabled| is false then this will only include enabled |
96 // extensions. Use instead: | 96 // extensions. Use instead: |
97 // | 97 // |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 // ExtensionServiceInterface implementation. | 201 // ExtensionServiceInterface implementation. |
202 // | 202 // |
203 // NOTE: Many of these methods are DEPRECATED. See the interface for details. | 203 // NOTE: Many of these methods are DEPRECATED. See the interface for details. |
204 extensions::PendingExtensionManager* pending_extension_manager() override; | 204 extensions::PendingExtensionManager* pending_extension_manager() override; |
205 const extensions::Extension* GetExtensionById( | 205 const extensions::Extension* GetExtensionById( |
206 const std::string& id, | 206 const std::string& id, |
207 bool include_disabled) const override; | 207 bool include_disabled) const override; |
208 const extensions::Extension* GetInstalledExtension( | 208 const extensions::Extension* GetInstalledExtension( |
209 const std::string& id) const override; | 209 const std::string& id) const override; |
210 bool UpdateExtension(const std::string& id, | 210 bool UpdateExtension(const extensions::CRXFileInfo& file, |
211 const base::FilePath& extension_path, | |
212 bool file_ownership_passed, | 211 bool file_ownership_passed, |
213 extensions::CrxInstaller** out_crx_installer) override; | 212 extensions::CrxInstaller** out_crx_installer) override; |
214 bool IsExtensionEnabled(const std::string& extension_id) const override; | 213 bool IsExtensionEnabled(const std::string& extension_id) const override; |
215 void UnloadExtension( | 214 void UnloadExtension( |
216 const std::string& extension_id, | 215 const std::string& extension_id, |
217 extensions::UnloadedExtensionInfo::Reason reason) override; | 216 extensions::UnloadedExtensionInfo::Reason reason) override; |
218 void RemoveComponentExtension(const std::string& extension_id) override; | 217 void RemoveComponentExtension(const std::string& extension_id) override; |
219 void AddExtension(const extensions::Extension* extension) override; | 218 void AddExtension(const extensions::Extension* extension) override; |
220 void AddComponentExtension(const extensions::Extension* extension) override; | 219 void AddComponentExtension(const extensions::Extension* extension) override; |
221 const extensions::Extension* GetPendingExtensionUpdate( | 220 const extensions::Extension* GetPendingExtensionUpdate( |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 GreylistUnknownDontChange); | 754 GreylistUnknownDontChange); |
756 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 755 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
757 ManagementPolicyProhibitsEnableOnInstalled); | 756 ManagementPolicyProhibitsEnableOnInstalled); |
758 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 757 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
759 BlockAndUnblockBlacklistedExtension); | 758 BlockAndUnblockBlacklistedExtension); |
760 | 759 |
761 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 760 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
762 }; | 761 }; |
763 | 762 |
764 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 763 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |