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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 // Did the extension ask to escalate its permission during an upgrade? | 141 // Did the extension ask to escalate its permission during an upgrade? |
142 bool DidExtensionEscalatePermissions(const std::string& id); | 142 bool DidExtensionEscalatePermissions(const std::string& id); |
143 | 143 |
144 // If |did_escalate| is true, the preferences for |extension| will be set to | 144 // If |did_escalate| is true, the preferences for |extension| will be set to |
145 // require the install warning when the user tries to enable. | 145 // require the install warning when the user tries to enable. |
146 void SetDidExtensionEscalatePermissions( | 146 void SetDidExtensionEscalatePermissions( |
147 const Extension* extension, | 147 const Extension* extension, |
148 bool did_escalate); | 148 bool did_escalate); |
149 | 149 |
| 150 // Does the extension declare requirements that the system does not meet? |
| 151 bool HasUnsupportedRequirements(const std::string& extension_id); |
| 152 |
| 153 // Remove any unsupported requirement warnings that this extension has. |
| 154 void ClearUnsupportedRequirements(const std::string& extension_id); |
| 155 |
| 156 void SetUnsupportedRequirements(const std::string& extension_id, |
| 157 std::vector<std::string> requirement_errors); |
| 158 |
| 159 std::vector<std::string> GetUnsupportedRequirements( |
| 160 const std::string& extension_id); |
| 161 |
150 // Getter and setters for disabled reason. | 162 // Getter and setters for disabled reason. |
151 Extension::DisableReason GetDisableReason( | 163 Extension::DisableReason GetDisableReason( |
152 const std::string& extension_id); | 164 const std::string& extension_id); |
153 void SetDisableReason(const std::string& extension_id, | 165 void SetDisableReason(const std::string& extension_id, |
154 Extension::DisableReason disable_reason); | 166 Extension::DisableReason disable_reason); |
155 void RemoveDisableReason(const std::string& extension_id); | 167 void RemoveDisableReason(const std::string& extension_id); |
156 | 168 |
157 // Returns the version string for the currently installed extension, or | 169 // Returns the version string for the currently installed extension, or |
158 // the empty string if not found. | 170 // the empty string if not found. |
159 std::string GetVersionString(const std::string& extension_id); | 171 std::string GetVersionString(const std::string& extension_id); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 friend class ExtensionPrefsUninstallExtension; // Unit test. | 461 friend class ExtensionPrefsUninstallExtension; // Unit test. |
450 | 462 |
451 // extensions::ContentSettingsStore::Observer methods: | 463 // extensions::ContentSettingsStore::Observer methods: |
452 virtual void OnContentSettingChanged(const std::string& extension_id, | 464 virtual void OnContentSettingChanged(const std::string& extension_id, |
453 bool incognito) OVERRIDE; | 465 bool incognito) OVERRIDE; |
454 | 466 |
455 // ExtensionScopedPrefs methods: | 467 // ExtensionScopedPrefs methods: |
456 virtual void UpdateExtensionPref(const std::string& id, | 468 virtual void UpdateExtensionPref(const std::string& id, |
457 const std::string& key, | 469 const std::string& key, |
458 base::Value* value) OVERRIDE; | 470 base::Value* value) OVERRIDE; |
| 471 virtual void UpdateExtensionPrefList(const std::string& id, |
| 472 const std::string& key, |
| 473 const std::vector<std::string>& value) |
| 474 OVERRIDE; |
459 virtual void DeleteExtensionPrefs(const std::string& id) OVERRIDE; | 475 virtual void DeleteExtensionPrefs(const std::string& id) OVERRIDE; |
460 virtual bool ReadExtensionPrefBoolean( | 476 virtual bool ReadExtensionPrefBoolean( |
461 const std::string& extension_id, | 477 const std::string& extension_id, |
462 const std::string& pref_key) const OVERRIDE; | 478 const std::string& pref_key) const OVERRIDE; |
463 virtual bool ReadExtensionPrefInteger(const std::string& extension_id, | 479 virtual bool ReadExtensionPrefInteger(const std::string& extension_id, |
464 const std::string& pref_key, | 480 const std::string& pref_key, |
465 int* out_value) const OVERRIDE; | 481 int* out_value) const OVERRIDE; |
466 virtual bool ReadExtensionPrefList( | 482 virtual bool ReadExtensionPrefList( |
467 const std::string& extension_id, | 483 const std::string& extension_id, |
468 const std::string& pref_key, | 484 const std::string& pref_key, |
469 const base::ListValue** out_value) const OVERRIDE; | 485 const base::ListValue** out_value) const OVERRIDE; |
| 486 virtual bool ReadExtensionPrefStringList( |
| 487 const std::string& extension_id, |
| 488 const std::string& pref_key, |
| 489 std::vector<std::string>* out_value) const OVERRIDE; |
470 virtual bool ReadExtensionPrefString(const std::string& extension_id, | 490 virtual bool ReadExtensionPrefString(const std::string& extension_id, |
471 const std::string& pref_key, | 491 const std::string& pref_key, |
472 std::string* out_value) const OVERRIDE; | 492 std::string* out_value) const OVERRIDE; |
473 | 493 |
474 // Converts absolute paths in the pref to paths relative to the | 494 // Converts absolute paths in the pref to paths relative to the |
475 // install_directory_. | 495 // install_directory_. |
476 void MakePathsRelative(); | 496 void MakePathsRelative(); |
477 | 497 |
478 // Converts internal relative paths to be absolute. Used for export to | 498 // Converts internal relative paths to be absolute. Used for export to |
479 // consumers who expect full paths. | 499 // consumers who expect full paths. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 scoped_ptr<ExtensionSorting> extension_sorting_; | 578 scoped_ptr<ExtensionSorting> extension_sorting_; |
559 | 579 |
560 scoped_refptr<ContentSettingsStore> content_settings_store_; | 580 scoped_refptr<ContentSettingsStore> content_settings_store_; |
561 | 581 |
562 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 582 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
563 }; | 583 }; |
564 | 584 |
565 } // namespace extensions | 585 } // namespace extensions |
566 | 586 |
567 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 587 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
OLD | NEW |