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_PREFS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 // Returns true if the specified external extension was uninstalled by the | 96 // Returns true if the specified external extension was uninstalled by the |
97 // user. | 97 // user. |
98 bool IsExternalExtensionUninstalled(const std::string& id) const; | 98 bool IsExternalExtensionUninstalled(const std::string& id) const; |
99 | 99 |
100 // Checks whether |extension_id| is disabled. If there's no state pref for | 100 // Checks whether |extension_id| is disabled. If there's no state pref for |
101 // the extension, this will return false. Generally you should use | 101 // the extension, this will return false. Generally you should use |
102 // ExtensionService::IsExtensionEnabled instead. | 102 // ExtensionService::IsExtensionEnabled instead. |
103 bool IsExtensionDisabled(const std::string& id) const; | 103 bool IsExtensionDisabled(const std::string& id) const; |
104 | 104 |
105 // Get the order that the browser actions appear in the toolbar. | 105 // Get/Set the order that the browser actions appear in the toolbar. |
106 std::vector<std::string> GetToolbarOrder(); | 106 ExtensionIdSet GetToolbarOrder(); |
| 107 void SetToolbarOrder(const ExtensionIdSet& extension_ids); |
107 | 108 |
108 // Set the order that the browser actions appear in the toolbar. | 109 // Get/Set the order that the browser actions appear in the action box. |
109 void SetToolbarOrder(const std::vector<std::string>& extension_ids); | 110 ExtensionIdSet GetActionBoxOrder(); |
| 111 void SetActionBoxOrder(const ExtensionIdSet& extension_ids); |
110 | 112 |
111 // Called when an extension is installed, so that prefs get created. | 113 // Called when an extension is installed, so that prefs get created. |
112 // If |page_ordinal| is an invalid ordinal, then a page will be found | 114 // If |page_ordinal| is an invalid ordinal, then a page will be found |
113 // for the App. | 115 // for the App. |
114 void OnExtensionInstalled(const Extension* extension, | 116 void OnExtensionInstalled(const Extension* extension, |
115 Extension::State initial_state, | 117 Extension::State initial_state, |
116 bool from_webstore, | 118 bool from_webstore, |
117 const StringOrdinal& page_ordinal); | 119 const StringOrdinal& page_ordinal); |
118 | 120 |
119 // Called when an extension is uninstalled, so that prefs get cleaned up. | 121 // Called when an extension is uninstalled, so that prefs get cleaned up. |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 void InitPrefStore(bool extensions_disabled); | 539 void InitPrefStore(bool extensions_disabled); |
538 | 540 |
539 // Migrates the permissions data in the pref store. | 541 // Migrates the permissions data in the pref store. |
540 void MigratePermissions(const ExtensionIdSet& extension_ids); | 542 void MigratePermissions(const ExtensionIdSet& extension_ids); |
541 | 543 |
542 // Checks whether there is a state pref for the extension and if so, whether | 544 // Checks whether there is a state pref for the extension and if so, whether |
543 // it matches |check_state|. | 545 // it matches |check_state|. |
544 bool DoesExtensionHaveState(const std::string& id, | 546 bool DoesExtensionHaveState(const std::string& id, |
545 Extension::State check_state) const; | 547 Extension::State check_state) const; |
546 | 548 |
| 549 // Helper function to Get/Set array of strings from/to prefs. |
| 550 ExtensionIdSet GetExtensionPrefAsVector(const char* pref); |
| 551 void SetExtensionPrefFromVector(const char* pref, |
| 552 const ExtensionIdSet& extension_ids); |
| 553 |
547 // The pref service specific to this set of extension prefs. Owned by profile. | 554 // The pref service specific to this set of extension prefs. Owned by profile. |
548 PrefService* prefs_; | 555 PrefService* prefs_; |
549 | 556 |
550 // Base extensions install directory. | 557 // Base extensions install directory. |
551 FilePath install_directory_; | 558 FilePath install_directory_; |
552 | 559 |
553 // Weak pointer, owned by Profile. | 560 // Weak pointer, owned by Profile. |
554 ExtensionPrefValueMap* extension_pref_value_map_; | 561 ExtensionPrefValueMap* extension_pref_value_map_; |
555 | 562 |
556 // Contains all the logic for handling the order for various extension | 563 // Contains all the logic for handling the order for various extension |
557 // properties. | 564 // properties. |
558 scoped_ptr<ExtensionSorting> extension_sorting_; | 565 scoped_ptr<ExtensionSorting> extension_sorting_; |
559 | 566 |
560 scoped_refptr<ContentSettingsStore> content_settings_store_; | 567 scoped_refptr<ContentSettingsStore> content_settings_store_; |
561 | 568 |
562 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 569 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
563 }; | 570 }; |
564 | 571 |
565 } // namespace extensions | 572 } // namespace extensions |
566 | 573 |
567 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 574 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
OLD | NEW |