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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // Did the extension ask to escalate its permission during an upgrade? | 145 // Did the extension ask to escalate its permission during an upgrade? |
146 bool DidExtensionEscalatePermissions(const std::string& id); | 146 bool DidExtensionEscalatePermissions(const std::string& id); |
147 | 147 |
148 // If |did_escalate| is true, the preferences for |extension| will be set to | 148 // If |did_escalate| is true, the preferences for |extension| will be set to |
149 // require the install warning when the user tries to enable. | 149 // require the install warning when the user tries to enable. |
150 void SetDidExtensionEscalatePermissions( | 150 void SetDidExtensionEscalatePermissions( |
151 const Extension* extension, | 151 const Extension* extension, |
152 bool did_escalate); | 152 bool did_escalate); |
153 | 153 |
154 // Getter and setters for disabled reason. | 154 // Getter and setters for disabled reason. |
155 Extension::DisableReason GetDisableReason( | 155 int GetDisableReasons(const std::string& extension_id); |
156 const std::string& extension_id); | 156 void AddDisableReason(const std::string& extension_id, |
157 void SetDisableReason(const std::string& extension_id, | |
158 Extension::DisableReason disable_reason); | 157 Extension::DisableReason disable_reason); |
159 void RemoveDisableReason(const std::string& extension_id); | 158 void RemoveDisableReason(const std::string& extension_id, |
| 159 Extension::DisableReason disable_reason); |
| 160 void ClearDisableReasons(const std::string& extension_id); |
160 | 161 |
161 // Returns the version string for the currently installed extension, or | 162 // Returns the version string for the currently installed extension, or |
162 // the empty string if not found. | 163 // the empty string if not found. |
163 std::string GetVersionString(const std::string& extension_id); | 164 std::string GetVersionString(const std::string& extension_id); |
164 | 165 |
165 // Re-writes the extension manifest into the prefs. | 166 // Re-writes the extension manifest into the prefs. |
166 // Called to change the extension's manifest when it's re-localized. | 167 // Called to change the extension's manifest when it's re-localized. |
167 void UpdateManifest(const Extension* extension); | 168 void UpdateManifest(const Extension* extension); |
168 | 169 |
169 // Returns extension path based on extension ID, or empty FilePath on error. | 170 // Returns extension path based on extension ID, or empty FilePath on error. |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 // in a later Chrome version. | 548 // in a later Chrome version. |
548 void FixMissingPrefs(const ExtensionIdSet& extension_ids); | 549 void FixMissingPrefs(const ExtensionIdSet& extension_ids); |
549 | 550 |
550 // Installs the persistent extension preferences into |prefs_|'s extension | 551 // Installs the persistent extension preferences into |prefs_|'s extension |
551 // pref store. Does nothing if |extensions_disabled| is true. | 552 // pref store. Does nothing if |extensions_disabled| is true. |
552 void InitPrefStore(bool extensions_disabled); | 553 void InitPrefStore(bool extensions_disabled); |
553 | 554 |
554 // Migrates the permissions data in the pref store. | 555 // Migrates the permissions data in the pref store. |
555 void MigratePermissions(const ExtensionIdSet& extension_ids); | 556 void MigratePermissions(const ExtensionIdSet& extension_ids); |
556 | 557 |
| 558 // Migrates the disable reasons from a single enum to a bit mask. |
| 559 void MigrateDisableReasons(const ExtensionIdSet& extension_ids); |
| 560 |
557 // Checks whether there is a state pref for the extension and if so, whether | 561 // Checks whether there is a state pref for the extension and if so, whether |
558 // it matches |check_state|. | 562 // it matches |check_state|. |
559 bool DoesExtensionHaveState(const std::string& id, | 563 bool DoesExtensionHaveState(const std::string& id, |
560 Extension::State check_state) const; | 564 Extension::State check_state) const; |
561 | 565 |
562 // Helper function to Get/Set array of strings from/to prefs. | 566 // Helper function to Get/Set array of strings from/to prefs. |
563 ExtensionIdSet GetExtensionPrefAsVector(const char* pref); | 567 ExtensionIdSet GetExtensionPrefAsVector(const char* pref); |
564 void SetExtensionPrefFromVector(const char* pref, | 568 void SetExtensionPrefFromVector(const char* pref, |
565 const ExtensionIdSet& extension_ids); | 569 const ExtensionIdSet& extension_ids); |
566 | 570 |
(...skipping 11 matching lines...) Expand all Loading... |
578 scoped_ptr<ExtensionSorting> extension_sorting_; | 582 scoped_ptr<ExtensionSorting> extension_sorting_; |
579 | 583 |
580 scoped_refptr<ContentSettingsStore> content_settings_store_; | 584 scoped_refptr<ContentSettingsStore> content_settings_store_; |
581 | 585 |
582 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 586 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
583 }; | 587 }; |
584 | 588 |
585 } // namespace extensions | 589 } // namespace extensions |
586 | 590 |
587 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 591 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
OLD | NEW |