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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 } | 688 } |
689 | 689 |
690 // Adds/Removes update observers. | 690 // Adds/Removes update observers. |
691 void AddUpdateObserver(extensions::UpdateObserver* observer); | 691 void AddUpdateObserver(extensions::UpdateObserver* observer); |
692 void RemoveUpdateObserver(extensions::UpdateObserver* observer); | 692 void RemoveUpdateObserver(extensions::UpdateObserver* observer); |
693 | 693 |
694 // |flare| provides a StartSyncFlare to the SyncableService. See | 694 // |flare| provides a StartSyncFlare to the SyncableService. See |
695 // sync_start_util for more. | 695 // sync_start_util for more. |
696 void SetSyncStartFlare(const syncer::SyncableService::StartSyncFlare& flare); | 696 void SetSyncStartFlare(const syncer::SyncableService::StartSyncFlare& flare); |
697 | 697 |
| 698 #if defined(OS_CHROMEOS) |
| 699 void disable_garbage_collection() { |
| 700 disable_garbage_collection_ = true; |
| 701 } |
| 702 void enable_garbage_collection() { |
| 703 disable_garbage_collection_ = false; |
| 704 } |
| 705 #endif |
| 706 |
698 private: | 707 private: |
699 // Contains Extension data that can change during the life of the process, | 708 // Contains Extension data that can change during the life of the process, |
700 // but does not persist across restarts. | 709 // but does not persist across restarts. |
701 struct ExtensionRuntimeData { | 710 struct ExtensionRuntimeData { |
702 // True if the background page is ready. | 711 // True if the background page is ready. |
703 bool background_page_ready; | 712 bool background_page_ready; |
704 | 713 |
705 // True while the extension is being upgraded. | 714 // True while the extension is being upgraded. |
706 bool being_upgraded; | 715 bool being_upgraded; |
707 | 716 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 scoped_ptr<extensions::ManagementPolicy::Provider> | 962 scoped_ptr<extensions::ManagementPolicy::Provider> |
954 shared_module_policy_provider_; | 963 shared_module_policy_provider_; |
955 | 964 |
956 ObserverList<extensions::UpdateObserver, true> update_observers_; | 965 ObserverList<extensions::UpdateObserver, true> update_observers_; |
957 | 966 |
958 // Run()ning tells sync to try and start soon, because syncable changes | 967 // Run()ning tells sync to try and start soon, because syncable changes |
959 // have started happening. It will cause sync to call us back | 968 // have started happening. It will cause sync to call us back |
960 // asynchronously via MergeDataAndStartSyncing as soon as possible. | 969 // asynchronously via MergeDataAndStartSyncing as soon as possible. |
961 syncer::SyncableService::StartSyncFlare flare_; | 970 syncer::SyncableService::StartSyncFlare flare_; |
962 | 971 |
| 972 #if defined(OS_CHROMEOS) |
| 973 // TODO(rkc): HACK alert - this is only in place to allow the |
| 974 // kiosk_mode_screensaver to prevent its extension from getting garbage |
| 975 // collected. Remove this once KioskModeScreensaver is removed. |
| 976 // See crbug.com/280363 |
| 977 bool disable_garbage_collection_; |
| 978 #endif |
| 979 |
963 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 980 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
964 InstallAppsWithUnlimtedStorage); | 981 InstallAppsWithUnlimtedStorage); |
965 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 982 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
966 InstallAppsAndCheckStorageProtection); | 983 InstallAppsAndCheckStorageProtection); |
967 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 984 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
968 }; | 985 }; |
969 | 986 |
970 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 987 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |