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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 the order that the browser actions appear in the toolbar. |
106 std::vector<std::string> GetToolbarOrder(); | 106 std::vector<std::string> GetToolbarOrder(); |
Peter Kasting
2012/07/21 01:55:13
Nit: The actual implementation of this uses Extens
yefimt
2012/07/23 23:47:52
Done.
| |
107 | 107 |
108 // Set the order that the browser actions appear in the toolbar. | 108 // Set the order that the browser actions appear in the toolbar. |
Peter Kasting
2012/07/21 01:55:13
Nit: Eliminate this comment and the blank line abo
yefimt
2012/07/23 23:47:52
Done.
| |
109 void SetToolbarOrder(const std::vector<std::string>& extension_ids); | 109 void SetToolbarOrder(const std::vector<std::string>& extension_ids); |
110 | 110 |
111 // Get/Set the order that the browser actions appear in the action box. | |
112 std::vector<std::string> GetActionBoxOrder(); | |
113 void SetActionBoxOrder(const std::vector<std::string>& extension_ids); | |
114 | |
111 // Called when an extension is installed, so that prefs get created. | 115 // 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 | 116 // If |page_ordinal| is an invalid ordinal, then a page will be found |
113 // for the App. | 117 // for the App. |
114 void OnExtensionInstalled(const Extension* extension, | 118 void OnExtensionInstalled(const Extension* extension, |
115 Extension::State initial_state, | 119 Extension::State initial_state, |
116 bool from_webstore, | 120 bool from_webstore, |
117 const StringOrdinal& page_ordinal); | 121 const StringOrdinal& page_ordinal); |
118 | 122 |
119 // Called when an extension is uninstalled, so that prefs get cleaned up. | 123 // Called when an extension is uninstalled, so that prefs get cleaned up. |
120 void OnExtensionUninstalled(const std::string& extension_id, | 124 void OnExtensionUninstalled(const std::string& extension_id, |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
537 void InitPrefStore(bool extensions_disabled); | 541 void InitPrefStore(bool extensions_disabled); |
538 | 542 |
539 // Migrates the permissions data in the pref store. | 543 // Migrates the permissions data in the pref store. |
540 void MigratePermissions(const ExtensionIdSet& extension_ids); | 544 void MigratePermissions(const ExtensionIdSet& extension_ids); |
541 | 545 |
542 // Checks whether there is a state pref for the extension and if so, whether | 546 // Checks whether there is a state pref for the extension and if so, whether |
543 // it matches |check_state|. | 547 // it matches |check_state|. |
544 bool DoesExtensionHaveState(const std::string& id, | 548 bool DoesExtensionHaveState(const std::string& id, |
545 Extension::State check_state) const; | 549 Extension::State check_state) const; |
546 | 550 |
551 // Helper function to Get/Set array of strings from/to prefs. | |
552 std::vector<std::string> GetExtensionPrefAsVector(const char* pref); | |
553 void SetExtensionPrefFromVector( | |
554 const char* pref, | |
555 const std::vector<std::string>& extension_ids); | |
556 | |
547 // The pref service specific to this set of extension prefs. Owned by profile. | 557 // The pref service specific to this set of extension prefs. Owned by profile. |
548 PrefService* prefs_; | 558 PrefService* prefs_; |
549 | 559 |
550 // Base extensions install directory. | 560 // Base extensions install directory. |
551 FilePath install_directory_; | 561 FilePath install_directory_; |
552 | 562 |
553 // Weak pointer, owned by Profile. | 563 // Weak pointer, owned by Profile. |
554 ExtensionPrefValueMap* extension_pref_value_map_; | 564 ExtensionPrefValueMap* extension_pref_value_map_; |
555 | 565 |
556 // Contains all the logic for handling the order for various extension | 566 // Contains all the logic for handling the order for various extension |
557 // properties. | 567 // properties. |
558 scoped_ptr<ExtensionSorting> extension_sorting_; | 568 scoped_ptr<ExtensionSorting> extension_sorting_; |
559 | 569 |
560 scoped_refptr<ContentSettingsStore> content_settings_store_; | 570 scoped_refptr<ContentSettingsStore> content_settings_store_; |
561 | 571 |
562 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 572 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
563 }; | 573 }; |
564 | 574 |
565 } // namespace extensions | 575 } // namespace extensions |
566 | 576 |
567 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 577 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
OLD | NEW |