| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/file_path.h" | 17 #include "base/file_path.h" |
| 18 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
| 19 #include "base/memory/linked_ptr.h" | 19 #include "base/memory/linked_ptr.h" |
| 20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
| 21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
| 22 #include "base/property_bag.h" | 22 #include "base/property_bag.h" |
| 23 #include "base/string16.h" |
| 23 #include "base/time.h" | 24 #include "base/time.h" |
| 24 #include "base/tuple.h" | 25 #include "base/tuple.h" |
| 25 #include "chrome/browser/extensions/api/api_resource_controller.h" | 26 #include "chrome/browser/extensions/api/api_resource_controller.h" |
| 26 #include "chrome/browser/extensions/app_shortcut_manager.h" | 27 #include "chrome/browser/extensions/app_shortcut_manager.h" |
| 27 #include "chrome/browser/extensions/app_sync_bundle.h" | 28 #include "chrome/browser/extensions/app_sync_bundle.h" |
| 28 #include "chrome/browser/extensions/apps_promo.h" | 29 #include "chrome/browser/extensions/apps_promo.h" |
| 29 #include "chrome/browser/extensions/extension_icon_manager.h" | 30 #include "chrome/browser/extensions/extension_icon_manager.h" |
| 30 #include "chrome/browser/extensions/extension_menu_manager.h" | 31 #include "chrome/browser/extensions/extension_menu_manager.h" |
| 31 #include "chrome/browser/extensions/extension_prefs.h" | 32 #include "chrome/browser/extensions/extension_prefs.h" |
| 32 #include "chrome/browser/extensions/extension_process_manager.h" | 33 #include "chrome/browser/extensions/extension_process_manager.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // callers should never set to true. | 323 // callers should never set to true. |
| 323 // | 324 // |
| 324 // We pass the |extension_id| by value to avoid having it deleted from under | 325 // We pass the |extension_id| by value to avoid having it deleted from under |
| 325 // us incase someone calls it with Extension::id() or another string that we | 326 // us incase someone calls it with Extension::id() or another string that we |
| 326 // are going to delete in this function. | 327 // are going to delete in this function. |
| 327 // | 328 // |
| 328 // TODO(aa): Remove |external_uninstall| -- this information should be passed | 329 // TODO(aa): Remove |external_uninstall| -- this information should be passed |
| 329 // to ExtensionPrefs some other way. | 330 // to ExtensionPrefs some other way. |
| 330 virtual bool UninstallExtension(std::string extension_id, | 331 virtual bool UninstallExtension(std::string extension_id, |
| 331 bool external_uninstall, | 332 bool external_uninstall, |
| 332 std::string* error); | 333 string16* error); |
| 333 | 334 |
| 334 virtual bool IsExtensionEnabled( | 335 virtual bool IsExtensionEnabled( |
| 335 const std::string& extension_id) const OVERRIDE; | 336 const std::string& extension_id) const OVERRIDE; |
| 336 virtual bool IsExternalExtensionUninstalled( | 337 virtual bool IsExternalExtensionUninstalled( |
| 337 const std::string& extension_id) const OVERRIDE; | 338 const std::string& extension_id) const OVERRIDE; |
| 338 | 339 |
| 339 // Enables the extension. If the extension is already enabled, does | 340 // Enables the extension. If the extension is already enabled, does |
| 340 // nothing. | 341 // nothing. |
| 341 virtual void EnableExtension(const std::string& extension_id); | 342 virtual void EnableExtension(const std::string& extension_id); |
| 342 | 343 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 // Initializes the |extension|'s active permission set and disables the | 404 // Initializes the |extension|'s active permission set and disables the |
| 404 // extension if the privilege level has increased (e.g., due to an upgrade). | 405 // extension if the privilege level has increased (e.g., due to an upgrade). |
| 405 void InitializePermissions(const extensions::Extension* extension); | 406 void InitializePermissions(const extensions::Extension* extension); |
| 406 | 407 |
| 407 // Go through each extensions in pref, unload blacklisted extensions | 408 // Go through each extensions in pref, unload blacklisted extensions |
| 408 // and update the blacklist state in pref. | 409 // and update the blacklist state in pref. |
| 409 virtual void UpdateExtensionBlacklist( | 410 virtual void UpdateExtensionBlacklist( |
| 410 const std::vector<std::string>& blacklist) OVERRIDE; | 411 const std::vector<std::string>& blacklist) OVERRIDE; |
| 411 | 412 |
| 412 // Go through each extension and unload those that the network admin has | 413 // Go through each extension and unload those that the network admin has |
| 413 // put on the blacklist (not to be confused with the Google managed blacklist | 414 // put on the blacklist (not to be confused with the Google-managed blacklist) |
| 414 // set of extensions. | 415 // set of extensions. |
| 415 virtual void CheckAdminBlacklist() OVERRIDE; | 416 virtual void CheckAdminBlacklist() OVERRIDE; |
| 416 | 417 |
| 417 virtual void CheckForUpdatesSoon() OVERRIDE; | 418 virtual void CheckForUpdatesSoon() OVERRIDE; |
| 418 | 419 |
| 419 // SyncableService implementation. | 420 // SyncableService implementation. |
| 420 virtual SyncError MergeDataAndStartSyncing( | 421 virtual SyncError MergeDataAndStartSyncing( |
| 421 syncable::ModelType type, | 422 syncable::ModelType type, |
| 422 const SyncDataList& initial_sync_data, | 423 const SyncDataList& initial_sync_data, |
| 423 scoped_ptr<SyncChangeProcessor> sync_processor, | 424 scoped_ptr<SyncChangeProcessor> sync_processor, |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 scoped_ptr<ExtensionGlobalError> extension_global_error_; | 847 scoped_ptr<ExtensionGlobalError> extension_global_error_; |
| 847 | 848 |
| 848 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 849 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 849 InstallAppsWithUnlimtedStorage); | 850 InstallAppsWithUnlimtedStorage); |
| 850 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 851 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 851 InstallAppsAndCheckStorageProtection); | 852 InstallAppsAndCheckStorageProtection); |
| 852 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 853 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 853 }; | 854 }; |
| 854 | 855 |
| 855 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 856 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |