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> |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 // put on the blacklist (not to be confused with the Google managed blacklist | 412 // put on the blacklist (not to be confused with the Google managed blacklist |
413 // set of extensions. | 413 // set of extensions. |
414 virtual void CheckAdminBlacklist() OVERRIDE; | 414 virtual void CheckAdminBlacklist() OVERRIDE; |
415 | 415 |
416 virtual void CheckForUpdatesSoon() OVERRIDE; | 416 virtual void CheckForUpdatesSoon() OVERRIDE; |
417 | 417 |
418 // SyncableService implementation. | 418 // SyncableService implementation. |
419 virtual SyncError MergeDataAndStartSyncing( | 419 virtual SyncError MergeDataAndStartSyncing( |
420 syncable::ModelType type, | 420 syncable::ModelType type, |
421 const SyncDataList& initial_sync_data, | 421 const SyncDataList& initial_sync_data, |
422 SyncChangeProcessor* sync_processor) OVERRIDE; | 422 scoped_ptr<SyncChangeProcessor> sync_processor) OVERRIDE; |
423 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 423 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; |
424 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; | 424 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; |
425 virtual SyncError ProcessSyncChanges( | 425 virtual SyncError ProcessSyncChanges( |
426 const tracked_objects::Location& from_here, | 426 const tracked_objects::Location& from_here, |
427 const SyncChangeList& change_list) OVERRIDE; | 427 const SyncChangeList& change_list) OVERRIDE; |
428 | 428 |
429 void set_extensions_enabled(bool enabled) { extensions_enabled_ = enabled; } | 429 void set_extensions_enabled(bool enabled) { extensions_enabled_ = enabled; } |
430 bool extensions_enabled() { return extensions_enabled_; } | 430 bool extensions_enabled() { return extensions_enabled_; } |
431 | 431 |
432 void set_show_extensions_prompts(bool enabled) { | 432 void set_show_extensions_prompts(bool enabled) { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 extensions::RulesRegistryService* GetRulesRegistryService(); | 584 extensions::RulesRegistryService* GetRulesRegistryService(); |
585 | 585 |
586 AppShortcutManager* app_shortcut_manager() { return &app_shortcut_manager_; } | 586 AppShortcutManager* app_shortcut_manager() { return &app_shortcut_manager_; } |
587 | 587 |
588 private: | 588 private: |
589 // Bundle of type (app or extension)-specific sync stuff. | 589 // Bundle of type (app or extension)-specific sync stuff. |
590 struct SyncBundle { | 590 struct SyncBundle { |
591 SyncBundle(); | 591 SyncBundle(); |
592 ~SyncBundle(); | 592 ~SyncBundle(); |
593 | 593 |
| 594 void Reset(); |
| 595 |
594 bool HasExtensionId(const std::string& id) const; | 596 bool HasExtensionId(const std::string& id) const; |
595 bool HasPendingExtensionId(const std::string& id) const; | 597 bool HasPendingExtensionId(const std::string& id) const; |
596 | 598 |
| 599 // Note: all members of the struct need to be explicitly cleared in Reset(). |
597 ExtensionFilter filter; | 600 ExtensionFilter filter; |
598 std::set<std::string> synced_extensions; | 601 std::set<std::string> synced_extensions; |
599 std::map<std::string, ExtensionSyncData> pending_sync_data; | 602 std::map<std::string, ExtensionSyncData> pending_sync_data; |
600 SyncChangeProcessor* sync_processor; | 603 scoped_ptr<SyncChangeProcessor> sync_processor; |
601 }; | 604 }; |
602 | 605 |
603 // Contains Extension data that can change during the life of the process, | 606 // Contains Extension data that can change during the life of the process, |
604 // but does not persist across restarts. | 607 // but does not persist across restarts. |
605 struct ExtensionRuntimeData { | 608 struct ExtensionRuntimeData { |
606 // True if the background page is ready. | 609 // True if the background page is ready. |
607 bool background_page_ready; | 610 bool background_page_ready; |
608 | 611 |
609 // True while the extension is being upgraded. | 612 // True while the extension is being upgraded. |
610 bool being_upgraded; | 613 bool being_upgraded; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 scoped_ptr<ExtensionGlobalError> extension_global_error_; | 844 scoped_ptr<ExtensionGlobalError> extension_global_error_; |
842 | 845 |
843 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 846 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
844 InstallAppsWithUnlimtedStorage); | 847 InstallAppsWithUnlimtedStorage); |
845 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 848 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
846 InstallAppsAndCheckStorageProtection); | 849 InstallAppsAndCheckStorageProtection); |
847 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 850 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
848 }; | 851 }; |
849 | 852 |
850 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 853 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |