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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(); |
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. |
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(const char* pref, |
| 554 const std::vector<std::string>& extension_ids); |
| 555 |
547 // The pref service specific to this set of extension prefs. Owned by profile. | 556 // The pref service specific to this set of extension prefs. Owned by profile. |
548 PrefService* prefs_; | 557 PrefService* prefs_; |
549 | 558 |
550 // Base extensions install directory. | 559 // Base extensions install directory. |
551 FilePath install_directory_; | 560 FilePath install_directory_; |
552 | 561 |
553 // Weak pointer, owned by Profile. | 562 // Weak pointer, owned by Profile. |
554 ExtensionPrefValueMap* extension_pref_value_map_; | 563 ExtensionPrefValueMap* extension_pref_value_map_; |
555 | 564 |
556 // Contains all the logic for handling the order for various extension | 565 // Contains all the logic for handling the order for various extension |
557 // properties. | 566 // properties. |
558 scoped_ptr<ExtensionSorting> extension_sorting_; | 567 scoped_ptr<ExtensionSorting> extension_sorting_; |
559 | 568 |
560 scoped_refptr<ContentSettingsStore> content_settings_store_; | 569 scoped_refptr<ContentSettingsStore> content_settings_store_; |
561 | 570 |
562 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 571 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
563 }; | 572 }; |
564 | 573 |
565 } // namespace extensions | 574 } // namespace extensions |
566 | 575 |
567 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 576 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
OLD | NEW |