| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_EXTENSIONS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // a struct without manual parsing. | 67 // a struct without manual parsing. |
| 68 struct ExtensionHeader { | 68 struct ExtensionHeader { |
| 69 char magic[kExtensionHeaderMagicSize]; | 69 char magic[kExtensionHeaderMagicSize]; |
| 70 uint32 version; | 70 uint32 version; |
| 71 size_t key_size; // The size of the public key, in bytes. | 71 size_t key_size; // The size of the public key, in bytes. |
| 72 size_t signature_size; // The size of the signature, in bytes. | 72 size_t signature_size; // The size of the signature, in bytes. |
| 73 // An ASN.1-encoded PublicKeyInfo structure follows. | 73 // An ASN.1-encoded PublicKeyInfo structure follows. |
| 74 // The signature follows. | 74 // The signature follows. |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 // The name of the directory inside the profile where extensions are |
| 78 // installed to. |
| 79 static const char* kInstallDirectoryName; |
| 80 |
| 77 ExtensionsService(Profile* profile, | 81 ExtensionsService(Profile* profile, |
| 78 const CommandLine* command_line, | 82 const CommandLine* command_line, |
| 83 PrefService* prefs, |
| 84 const FilePath& install_directory, |
| 79 MessageLoop* frontend_loop, | 85 MessageLoop* frontend_loop, |
| 80 MessageLoop* backend_loop); | 86 MessageLoop* backend_loop); |
| 81 ~ExtensionsService(); | 87 ~ExtensionsService(); |
| 82 | 88 |
| 83 // Gets the list of currently installed extensions. | 89 // Gets the list of currently installed extensions. |
| 84 const ExtensionList* extensions() const { | 90 const ExtensionList* extensions() const { |
| 85 return &extensions_; | 91 return &extensions_; |
| 86 } | 92 } |
| 87 | 93 |
| 88 // Initialize and start all installed extensions. | 94 // Initialize and start all installed extensions. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 void FireInstallCallback(const FilePath& path, Extension* extension); | 195 void FireInstallCallback(const FilePath& path, Extension* extension); |
| 190 | 196 |
| 191 // Called by the backend when there was an error installing an extension. | 197 // Called by the backend when there was an error installing an extension. |
| 192 void OnExtenionInstallError(const FilePath& path); | 198 void OnExtenionInstallError(const FilePath& path); |
| 193 | 199 |
| 194 // Called by the backend when an attempt was made to reinstall the same | 200 // Called by the backend when an attempt was made to reinstall the same |
| 195 // version of an existing extension. | 201 // version of an existing extension. |
| 196 void OnExtensionOverinstallAttempted(const std::string& id, | 202 void OnExtensionOverinstallAttempted(const std::string& id, |
| 197 const FilePath& path); | 203 const FilePath& path); |
| 198 | 204 |
| 199 // The name of the directory inside the profile where extensions are | |
| 200 // installed to. | |
| 201 static const char* kInstallDirectoryName; | |
| 202 | |
| 203 // Preferences for the owning profile. | 205 // Preferences for the owning profile. |
| 204 scoped_ptr<ExtensionPrefs> extension_prefs_; | 206 scoped_ptr<ExtensionPrefs> extension_prefs_; |
| 205 | 207 |
| 206 // Controls how the various extension processes get created and destroyed. | 208 // Controls how the various extension processes get created and destroyed. |
| 207 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 209 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
| 208 | 210 |
| 209 // The message loop to use with the backend. | 211 // The message loop to use with the backend. |
| 210 MessageLoop* backend_loop_; | 212 MessageLoop* backend_loop_; |
| 211 | 213 |
| 212 // The current list of installed extensions. | 214 // The current list of installed extensions. |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 | 454 |
| 453 // A map of all external extension providers. | 455 // A map of all external extension providers. |
| 454 typedef std::map<Extension::Location, | 456 typedef std::map<Extension::Location, |
| 455 linked_ptr<ExternalExtensionProvider> > ProviderMap; | 457 linked_ptr<ExternalExtensionProvider> > ProviderMap; |
| 456 ProviderMap external_extension_providers_; | 458 ProviderMap external_extension_providers_; |
| 457 | 459 |
| 458 DISALLOW_COPY_AND_ASSIGN(ExtensionsServiceBackend); | 460 DISALLOW_COPY_AND_ASSIGN(ExtensionsServiceBackend); |
| 459 }; | 461 }; |
| 460 | 462 |
| 461 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ | 463 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ |
| OLD | NEW |