| OLD | NEW |
| 1 // Copyright (c) 2010 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_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.h" | 29 #include "chrome/browser/extensions/external_extension_provider.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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 | 404 |
| 404 // Note that this may return NULL if autoupdate is not turned on. | 405 // Note that this may return NULL if autoupdate is not turned on. |
| 405 ExtensionUpdater* updater() { return updater_.get(); } | 406 ExtensionUpdater* updater() { return updater_.get(); } |
| 406 | 407 |
| 407 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } | 408 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } |
| 408 | 409 |
| 409 ExtensionsQuotaService* quota_service() { return "a_service_; } | 410 ExtensionsQuotaService* quota_service() { return "a_service_; } |
| 410 | 411 |
| 411 ExtensionMenuManager* menu_manager() { return &menu_manager_; } | 412 ExtensionMenuManager* menu_manager() { return &menu_manager_; } |
| 412 | 413 |
| 414 ExtensionBrowserEventRouter* browser_event_router() { |
| 415 return browser_event_router_.get(); |
| 416 } |
| 417 |
| 413 const std::map<GURL, int>& protected_storage_map() const { | 418 const std::map<GURL, int>& protected_storage_map() const { |
| 414 return protected_storage_map_; | 419 return protected_storage_map_; |
| 415 } | 420 } |
| 416 | 421 |
| 417 // Notify the frontend that there was an error loading an extension. | 422 // Notify the frontend that there was an error loading an extension. |
| 418 // This method is public because ExtensionServiceBackend can post to here. | 423 // This method is public because ExtensionServiceBackend can post to here. |
| 419 void ReportExtensionLoadError(const FilePath& extension_path, | 424 void ReportExtensionLoadError(const FilePath& extension_path, |
| 420 const std::string& error, | 425 const std::string& error, |
| 421 NotificationType type, | 426 NotificationType type, |
| 422 bool be_noisy); | 427 bool be_noisy); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 typedef std::map<GURL, int> ProtectedStorageMap; | 587 typedef std::map<GURL, int> ProtectedStorageMap; |
| 583 ProtectedStorageMap protected_storage_map_; | 588 ProtectedStorageMap protected_storage_map_; |
| 584 | 589 |
| 585 // Manages the installation of default apps and the promotion of them in the | 590 // Manages the installation of default apps and the promotion of them in the |
| 586 // app launcher. | 591 // app launcher. |
| 587 DefaultApps default_apps_; | 592 DefaultApps default_apps_; |
| 588 | 593 |
| 589 // Flag to make sure event routers are only initialized once. | 594 // Flag to make sure event routers are only initialized once. |
| 590 bool event_routers_initialized_; | 595 bool event_routers_initialized_; |
| 591 | 596 |
| 597 scoped_ptr<ExtensionBrowserEventRouter> browser_event_router_; |
| 598 |
| 592 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 599 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 593 UpdatePendingExtensionAlreadyInstalled); | 600 UpdatePendingExtensionAlreadyInstalled); |
| 594 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 601 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 595 InstallAppsWithUnlimtedStorage); | 602 InstallAppsWithUnlimtedStorage); |
| 596 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 603 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 597 InstallAppsAndCheckStorageProtection); | 604 InstallAppsAndCheckStorageProtection); |
| 598 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 605 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 599 }; | 606 }; |
| 600 | 607 |
| 601 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 608 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |