Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: extensions/browser/extension_prefs.h

Issue 2147923002: [Extensions] Fixed removing from blacklist. (Closed) Base URL: ssh://bitbucket.browser.yandex-team.ru/chromium/src.git@master
Patch Set: Unnecessary extensions:: namespace is removed. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_PREFS_H_
6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ 6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 void ReplaceDisableReasons(const std::string& extension_id, 273 void ReplaceDisableReasons(const std::string& extension_id,
274 int disable_reasons); 274 int disable_reasons);
275 void ClearDisableReasons(const std::string& extension_id); 275 void ClearDisableReasons(const std::string& extension_id);
276 276
277 // Gets the set of extensions that have been blacklisted in prefs. This will 277 // Gets the set of extensions that have been blacklisted in prefs. This will
278 // return only the blocked extensions, not the "greylist" extensions. 278 // return only the blocked extensions, not the "greylist" extensions.
279 // TODO(oleg): Make method names consistent here, in extension service and in 279 // TODO(oleg): Make method names consistent here, in extension service and in
280 // blacklist. 280 // blacklist.
281 std::set<std::string> GetBlacklistedExtensions() const; 281 std::set<std::string> GetBlacklistedExtensions() const;
282 282
283 // Sets whether the extension with |id| is blacklisted.
284 void SetExtensionBlacklisted(const std::string& extension_id,
285 bool is_blacklisted);
286
287 // Returns the version string for the currently installed extension, or 283 // Returns the version string for the currently installed extension, or
288 // the empty string if not found. 284 // the empty string if not found.
289 std::string GetVersionString(const std::string& extension_id) const; 285 std::string GetVersionString(const std::string& extension_id) const;
290 286
291 // Re-writes the extension manifest into the prefs. 287 // Re-writes the extension manifest into the prefs.
292 // Called to change the extension's manifest when it's re-localized. 288 // Called to change the extension's manifest when it's re-localized.
293 void UpdateManifest(const Extension* extension); 289 void UpdateManifest(const Extension* extension);
294 290
295 // Returns base extensions install directory. 291 // Returns base extensions install directory.
296 const base::FilePath& install_directory() const { return install_directory_; } 292 const base::FilePath& install_directory() const { return install_directory_; }
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 const std::string& extension_id, 577 const std::string& extension_id,
582 const base::DictionaryValue* extension) const; 578 const base::DictionaryValue* extension) const;
583 579
584 // Interprets the list pref, |pref_key| in |extension_id|'s preferences, as a 580 // Interprets the list pref, |pref_key| in |extension_id|'s preferences, as a
585 // URLPatternSet. The |valid_schemes| specify how to parse the URLPatterns. 581 // URLPatternSet. The |valid_schemes| specify how to parse the URLPatterns.
586 bool ReadPrefAsURLPatternSet(const std::string& extension_id, 582 bool ReadPrefAsURLPatternSet(const std::string& extension_id,
587 const std::string& pref_key, 583 const std::string& pref_key,
588 URLPatternSet* result, 584 URLPatternSet* result,
589 int valid_schemes) const; 585 int valid_schemes) const;
590 586
587 // DEPRECATED. Use GetExtensionBlacklistState() instead.
588 // TODO(atuchin): Remove this once all clients are updated.
589 // Sets whether the extension with |id| is blacklisted.
590 void SetExtensionBlacklisted(const std::string& extension_id,
591 bool is_blacklisted);
592
591 // Converts |new_value| to a list of strings and sets the |pref_key| pref 593 // Converts |new_value| to a list of strings and sets the |pref_key| pref
592 // belonging to |extension_id|. 594 // belonging to |extension_id|.
593 void SetExtensionPrefURLPatternSet(const std::string& extension_id, 595 void SetExtensionPrefURLPatternSet(const std::string& extension_id,
594 const std::string& pref_key, 596 const std::string& pref_key,
595 const URLPatternSet& new_value); 597 const URLPatternSet& new_value);
596 598
597 // Read the boolean preference entry and return true if the preference exists 599 // Read the boolean preference entry and return true if the preference exists
598 // and the preference's value is true; false otherwise. 600 // and the preference's value is true; false otherwise.
599 bool ReadPrefAsBooleanAndReturn(const std::string& extension_id, 601 bool ReadPrefAsBooleanAndReturn(const std::string& extension_id,
600 const std::string& key) const; 602 const std::string& key) const;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 bool extensions_disabled_; 689 bool extensions_disabled_;
688 690
689 base::ObserverList<ExtensionPrefsObserver> observer_list_; 691 base::ObserverList<ExtensionPrefsObserver> observer_list_;
690 692
691 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); 693 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs);
692 }; 694 };
693 695
694 } // namespace extensions 696 } // namespace extensions
695 697
696 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ 698 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698