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 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 373 |
374 // Updates the |extension|'s granted permissions lists to include all | 374 // Updates the |extension|'s granted permissions lists to include all |
375 // permissions in the |extensions|'s manifest. | 375 // permissions in the |extensions|'s manifest. |
376 void GrantPermissions( | 376 void GrantPermissions( |
377 const extensions::Extension* extension, | 377 const extensions::Extension* extension, |
378 bool record_oauth2_grant); | 378 bool record_oauth2_grant); |
379 | 379 |
380 // Check for updates (or potentially new extensions from external providers) | 380 // Check for updates (or potentially new extensions from external providers) |
381 void CheckForExternalUpdates(); | 381 void CheckForExternalUpdates(); |
382 | 382 |
| 383 // For testing: CheckForExternalUpdates() is idempotent. Reset the flag |
| 384 // that causes the function to perform an early return after it's first |
| 385 // invocation. |
| 386 void ResetExternalUpdateCheckGuardForTests() { |
| 387 external_update_check_has_run_ = false; |
| 388 } |
| 389 |
383 // Unload the specified extension. | 390 // Unload the specified extension. |
384 virtual void UnloadExtension( | 391 virtual void UnloadExtension( |
385 const std::string& extension_id, | 392 const std::string& extension_id, |
386 extension_misc::UnloadedExtensionReason reason) OVERRIDE; | 393 extension_misc::UnloadedExtensionReason reason) OVERRIDE; |
387 | 394 |
388 // Unload all extensions. This is currently only called on shutdown, and | 395 // Unload all extensions. This is currently only called on shutdown, and |
389 // does not send notifications. | 396 // does not send notifications. |
390 void UnloadAllExtensions(); | 397 void UnloadAllExtensions(); |
391 | 398 |
392 // Called only by testing. | 399 // Called only by testing. |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 // idle. | 894 // idle. |
888 bool install_updates_when_idle_; | 895 bool install_updates_when_idle_; |
889 | 896 |
890 // Used by dispatchers to limit API quota for individual extensions. | 897 // Used by dispatchers to limit API quota for individual extensions. |
891 ExtensionsQuotaService quota_service_; | 898 ExtensionsQuotaService quota_service_; |
892 | 899 |
893 // Record that Init() has been called, and chrome::EXTENSIONS_READY | 900 // Record that Init() has been called, and chrome::EXTENSIONS_READY |
894 // has fired. | 901 // has fired. |
895 bool ready_; | 902 bool ready_; |
896 | 903 |
| 904 // Have we done an external update check yet? |
| 905 bool external_update_check_has_run_; |
| 906 |
897 // Our extension updater, if updates are turned on. | 907 // Our extension updater, if updates are turned on. |
898 scoped_ptr<extensions::ExtensionUpdater> updater_; | 908 scoped_ptr<extensions::ExtensionUpdater> updater_; |
899 | 909 |
900 // The model that tracks extensions with BrowserAction buttons. | 910 // The model that tracks extensions with BrowserAction buttons. |
901 ExtensionToolbarModel toolbar_model_; | 911 ExtensionToolbarModel toolbar_model_; |
902 | 912 |
903 // Map unloaded extensions' ids to their paths. When a temporarily loaded | 913 // Map unloaded extensions' ids to their paths. When a temporarily loaded |
904 // extension is unloaded, we lose the information about it and don't have | 914 // extension is unloaded, we lose the information about it and don't have |
905 // any in the extension preferences file. | 915 // any in the extension preferences file. |
906 typedef std::map<std::string, FilePath> UnloadedExtensionPathMap; | 916 typedef std::map<std::string, FilePath> UnloadedExtensionPathMap; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 #endif | 1018 #endif |
1009 | 1019 |
1010 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 1020 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
1011 InstallAppsWithUnlimtedStorage); | 1021 InstallAppsWithUnlimtedStorage); |
1012 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 1022 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
1013 InstallAppsAndCheckStorageProtection); | 1023 InstallAppsAndCheckStorageProtection); |
1014 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 1024 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
1015 }; | 1025 }; |
1016 | 1026 |
1017 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 1027 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |