| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/extensions/extension_toolbar_model.h" | 27 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 28 #include "chrome/browser/extensions/extensions_quota_service.h" | 28 #include "chrome/browser/extensions/extensions_quota_service.h" |
| 29 #include "chrome/browser/extensions/external_extension_provider_interface.h" | 29 #include "chrome/browser/extensions/external_extension_provider_interface.h" |
| 30 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 30 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
| 31 #include "chrome/browser/prefs/pref_change_registrar.h" | 31 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 32 #include "chrome/common/notification_observer.h" | 32 #include "chrome/common/notification_observer.h" |
| 33 #include "chrome/common/notification_registrar.h" | 33 #include "chrome/common/notification_registrar.h" |
| 34 #include "chrome/common/extensions/extension.h" | 34 #include "chrome/common/extensions/extension.h" |
| 35 #include "chrome/common/property_bag.h" | 35 #include "chrome/common/property_bag.h" |
| 36 | 36 |
| 37 class ExtensionBrowserEventRouter; |
| 37 class ExtensionServiceBackend; | 38 class ExtensionServiceBackend; |
| 38 class ExtensionToolbarModel; | 39 class ExtensionToolbarModel; |
| 39 class ExtensionUpdater; | 40 class ExtensionUpdater; |
| 40 class GURL; | 41 class GURL; |
| 41 class Profile; | 42 class Profile; |
| 42 class Version; | 43 class Version; |
| 43 | 44 |
| 44 typedef bool (*ShouldInstallExtensionPredicate)(const Extension&); | 45 typedef bool (*ShouldInstallExtensionPredicate)(const Extension&); |
| 45 | 46 |
| 46 // A pending extension is an extension that hasn't been installed yet | 47 // A pending extension is an extension that hasn't been installed yet |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 389 |
| 389 // Note that this may return NULL if autoupdate is not turned on. | 390 // Note that this may return NULL if autoupdate is not turned on. |
| 390 ExtensionUpdater* updater() { return updater_.get(); } | 391 ExtensionUpdater* updater() { return updater_.get(); } |
| 391 | 392 |
| 392 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } | 393 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } |
| 393 | 394 |
| 394 ExtensionsQuotaService* quota_service() { return "a_service_; } | 395 ExtensionsQuotaService* quota_service() { return "a_service_; } |
| 395 | 396 |
| 396 ExtensionMenuManager* menu_manager() { return &menu_manager_; } | 397 ExtensionMenuManager* menu_manager() { return &menu_manager_; } |
| 397 | 398 |
| 399 ExtensionBrowserEventRouter* browser_event_router() { |
| 400 return browser_event_router_.get(); |
| 401 } |
| 402 |
| 398 const std::map<GURL, int>& protected_storage_map() const { | 403 const std::map<GURL, int>& protected_storage_map() const { |
| 399 return protected_storage_map_; | 404 return protected_storage_map_; |
| 400 } | 405 } |
| 401 | 406 |
| 402 // Notify the frontend that there was an error loading an extension. | 407 // Notify the frontend that there was an error loading an extension. |
| 403 // This method is public because ExtensionServiceBackend can post to here. | 408 // This method is public because ExtensionServiceBackend can post to here. |
| 404 void ReportExtensionLoadError(const FilePath& extension_path, | 409 void ReportExtensionLoadError(const FilePath& extension_path, |
| 405 const std::string& error, | 410 const std::string& error, |
| 406 NotificationType type, | 411 NotificationType type, |
| 407 bool be_noisy); | 412 bool be_noisy); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 typedef std::map<GURL, int> ProtectedStorageMap; | 606 typedef std::map<GURL, int> ProtectedStorageMap; |
| 602 ProtectedStorageMap protected_storage_map_; | 607 ProtectedStorageMap protected_storage_map_; |
| 603 | 608 |
| 604 // Manages the installation of default apps and the promotion of them in the | 609 // Manages the installation of default apps and the promotion of them in the |
| 605 // app launcher. | 610 // app launcher. |
| 606 DefaultApps default_apps_; | 611 DefaultApps default_apps_; |
| 607 | 612 |
| 608 // Flag to make sure event routers are only initialized once. | 613 // Flag to make sure event routers are only initialized once. |
| 609 bool event_routers_initialized_; | 614 bool event_routers_initialized_; |
| 610 | 615 |
| 616 scoped_ptr<ExtensionBrowserEventRouter> browser_event_router_; |
| 617 |
| 611 // A collection of external extension providers. Each provider reads | 618 // A collection of external extension providers. Each provider reads |
| 612 // a source of external extension information. Examples include the | 619 // a source of external extension information. Examples include the |
| 613 // windows registry and external_extensions.json. | 620 // windows registry and external_extensions.json. |
| 614 ProviderCollection external_extension_providers_; | 621 ProviderCollection external_extension_providers_; |
| 615 | 622 |
| 616 // Set to true by OnExternalExtensionUpdateUrlFound() when an external | 623 // Set to true by OnExternalExtensionUpdateUrlFound() when an external |
| 617 // extension URL is found. Used in CheckForExternalUpdates() to see | 624 // extension URL is found. Used in CheckForExternalUpdates() to see |
| 618 // if an update check is needed to install pending extensions. | 625 // if an update check is needed to install pending extensions. |
| 619 bool external_extension_added_; | 626 bool external_extension_added_; |
| 620 | 627 |
| 621 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 628 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 622 UpdatePendingExtensionAlreadyInstalled); | 629 UpdatePendingExtensionAlreadyInstalled); |
| 623 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 630 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 624 InstallAppsWithUnlimtedStorage); | 631 InstallAppsWithUnlimtedStorage); |
| 625 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 632 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 626 InstallAppsAndCheckStorageProtection); | 633 InstallAppsAndCheckStorageProtection); |
| 627 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 634 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 628 }; | 635 }; |
| 629 | 636 |
| 630 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 637 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |