| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/linked_ptr.h" | 15 #include "base/linked_ptr.h" |
| 16 #include "base/ref_counted.h" | 16 #include "base/ref_counted.h" |
| 17 #include "base/task.h" | 17 #include "base/task.h" |
| 18 #include "base/time.h" | 18 #include "base/time.h" |
| 19 #include "base/tuple.h" | 19 #include "base/tuple.h" |
| 20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "chrome/browser/chrome_thread.h" | 21 #include "chrome/browser/chrome_thread.h" |
| 22 #include "chrome/browser/extensions/extension_menu_manager.h" |
| 22 #include "chrome/browser/extensions/extension_prefs.h" | 23 #include "chrome/browser/extensions/extension_prefs.h" |
| 23 #include "chrome/browser/extensions/extension_process_manager.h" | 24 #include "chrome/browser/extensions/extension_process_manager.h" |
| 24 #include "chrome/browser/extensions/extension_toolbar_model.h" | 25 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 25 #include "chrome/browser/extensions/extensions_quota_service.h" | 26 #include "chrome/browser/extensions/extensions_quota_service.h" |
| 26 #include "chrome/browser/extensions/external_extension_provider.h" | 27 #include "chrome/browser/extensions/external_extension_provider.h" |
| 27 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 28 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
| 28 #include "chrome/common/notification_observer.h" | 29 #include "chrome/common/notification_observer.h" |
| 29 #include "chrome/common/notification_registrar.h" | 30 #include "chrome/common/notification_registrar.h" |
| 30 #include "chrome/common/extensions/extension.h" | 31 #include "chrome/common/extensions/extension.h" |
| 31 | 32 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 // Whether the extension service is ready. | 266 // Whether the extension service is ready. |
| 266 bool is_ready() { return ready_; } | 267 bool is_ready() { return ready_; } |
| 267 | 268 |
| 268 // Note that this may return NULL if autoupdate is not turned on. | 269 // Note that this may return NULL if autoupdate is not turned on. |
| 269 ExtensionUpdater* updater() { return updater_.get(); } | 270 ExtensionUpdater* updater() { return updater_.get(); } |
| 270 | 271 |
| 271 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } | 272 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } |
| 272 | 273 |
| 273 ExtensionsQuotaService* quota_service() { return "a_service_; } | 274 ExtensionsQuotaService* quota_service() { return "a_service_; } |
| 274 | 275 |
| 276 // Access to menu items added by extensions. |
| 277 ExtensionMenuManager* menu_manager() { return &menu_manager_; } |
| 278 |
| 275 // Notify the frontend that there was an error loading an extension. | 279 // Notify the frontend that there was an error loading an extension. |
| 276 // This method is public because ExtensionsServiceBackend can post to here. | 280 // This method is public because ExtensionsServiceBackend can post to here. |
| 277 void ReportExtensionLoadError(const FilePath& extension_path, | 281 void ReportExtensionLoadError(const FilePath& extension_path, |
| 278 const std::string& error, | 282 const std::string& error, |
| 279 NotificationType type, | 283 NotificationType type, |
| 280 bool be_noisy); | 284 bool be_noisy); |
| 281 | 285 |
| 282 // NotificationObserver | 286 // NotificationObserver |
| 283 virtual void Observe(NotificationType type, | 287 virtual void Observe(NotificationType type, |
| 284 const NotificationSource& source, | 288 const NotificationSource& source, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 typedef std::map<std::string, FilePath> UnloadedExtensionPathMap; | 353 typedef std::map<std::string, FilePath> UnloadedExtensionPathMap; |
| 350 UnloadedExtensionPathMap unloaded_extension_paths_; | 354 UnloadedExtensionPathMap unloaded_extension_paths_; |
| 351 | 355 |
| 352 // Map of inspector cookies that are detached, waiting for an extension to be | 356 // Map of inspector cookies that are detached, waiting for an extension to be |
| 353 // reloaded. | 357 // reloaded. |
| 354 typedef std::map<std::string, int> OrphanedDevTools; | 358 typedef std::map<std::string, int> OrphanedDevTools; |
| 355 OrphanedDevTools orphaned_dev_tools_; | 359 OrphanedDevTools orphaned_dev_tools_; |
| 356 | 360 |
| 357 NotificationRegistrar registrar_; | 361 NotificationRegistrar registrar_; |
| 358 | 362 |
| 363 // Keeps track of menu items added by extensions. |
| 364 ExtensionMenuManager menu_manager_; |
| 365 |
| 359 // List of registered component extensions (see Extension::Location). | 366 // List of registered component extensions (see Extension::Location). |
| 360 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; | 367 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; |
| 361 RegisteredComponentExtensions component_extension_manifests_; | 368 RegisteredComponentExtensions component_extension_manifests_; |
| 362 | 369 |
| 363 DISALLOW_COPY_AND_ASSIGN(ExtensionsService); | 370 DISALLOW_COPY_AND_ASSIGN(ExtensionsService); |
| 364 }; | 371 }; |
| 365 | 372 |
| 366 // Implements IO for the ExtensionsService. | 373 // Implements IO for the ExtensionsService. |
| 367 // TODO(aa): This can probably move into the .cc file. | 374 // TODO(aa): This can probably move into the .cc file. |
| 368 class ExtensionsServiceBackend | 375 class ExtensionsServiceBackend |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 467 |
| 461 // A map of all external extension providers. | 468 // A map of all external extension providers. |
| 462 typedef std::map<Extension::Location, | 469 typedef std::map<Extension::Location, |
| 463 linked_ptr<ExternalExtensionProvider> > ProviderMap; | 470 linked_ptr<ExternalExtensionProvider> > ProviderMap; |
| 464 ProviderMap external_extension_providers_; | 471 ProviderMap external_extension_providers_; |
| 465 | 472 |
| 466 DISALLOW_COPY_AND_ASSIGN(ExtensionsServiceBackend); | 473 DISALLOW_COPY_AND_ASSIGN(ExtensionsServiceBackend); |
| 467 }; | 474 }; |
| 468 | 475 |
| 469 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ | 476 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ |
| OLD | NEW |