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

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

Issue 714133002: Add more management policy checking after extension installed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove two tests Created 6 years, 1 month 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
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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 void SetDidExtensionEscalatePermissions( 255 void SetDidExtensionEscalatePermissions(
256 const Extension* extension, 256 const Extension* extension,
257 bool did_escalate); 257 bool did_escalate);
258 258
259 // Getters and setters for disabled reason. 259 // Getters and setters for disabled reason.
260 int GetDisableReasons(const std::string& extension_id) const; 260 int GetDisableReasons(const std::string& extension_id) const;
261 bool HasDisableReason(const std::string& extension_id, 261 bool HasDisableReason(const std::string& extension_id,
262 Extension::DisableReason disable_reason) const; 262 Extension::DisableReason disable_reason) const;
263 void AddDisableReason(const std::string& extension_id, 263 void AddDisableReason(const std::string& extension_id,
264 Extension::DisableReason disable_reason); 264 Extension::DisableReason disable_reason);
265 void AddDisableReasons(const std::string& extension_id, int disable_reasons);
265 void RemoveDisableReason(const std::string& extension_id, 266 void RemoveDisableReason(const std::string& extension_id,
266 Extension::DisableReason disable_reason); 267 Extension::DisableReason disable_reason);
267 void ClearDisableReasons(const std::string& extension_id); 268 void ClearDisableReasons(const std::string& extension_id);
268 269
269 // Gets the set of extensions that have been blacklisted in prefs. This will 270 // Gets the set of extensions that have been blacklisted in prefs. This will
270 // return only the blocked extensions, not the "greylist" extensions. 271 // return only the blocked extensions, not the "greylist" extensions.
271 // TODO(oleg): Make method names consistent here, in extension service and in 272 // TODO(oleg): Make method names consistent here, in extension service and in
272 // blacklist. 273 // blacklist.
273 std::set<std::string> GetBlacklistedExtensions(); 274 std::set<std::string> GetBlacklistedExtensions();
274 275
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 const PermissionSet* new_value); 595 const PermissionSet* new_value);
595 596
596 // Returns an immutable dictionary for extension |id|'s prefs, or NULL if it 597 // Returns an immutable dictionary for extension |id|'s prefs, or NULL if it
597 // doesn't exist. 598 // doesn't exist.
598 const base::DictionaryValue* GetExtensionPref(const std::string& id) const; 599 const base::DictionaryValue* GetExtensionPref(const std::string& id) const;
599 600
600 // Modifies the extensions disable reasons to add a new reason, remove an 601 // Modifies the extensions disable reasons to add a new reason, remove an
601 // existing reason, or clear all reasons. Notifies observers if the set of 602 // existing reason, or clear all reasons. Notifies observers if the set of
602 // DisableReasons has changed. 603 // DisableReasons has changed.
603 // If |change| is DISABLE_REASON_CLEAR, then |reason| is ignored. 604 // If |change| is DISABLE_REASON_CLEAR, then |reason| is ignored.
604 void ModifyDisableReason(const std::string& extension_id, 605 void ModifyDisableReasons(const std::string& extension_id,
605 Extension::DisableReason reason, 606 int reasons,
606 DisableReasonChange change); 607 DisableReasonChange change);
607 608
608 // Fix missing preference entries in the extensions that are were introduced 609 // Fix missing preference entries in the extensions that are were introduced
609 // in a later Chrome version. 610 // in a later Chrome version.
610 void FixMissingPrefs(const ExtensionIdList& extension_ids); 611 void FixMissingPrefs(const ExtensionIdList& extension_ids);
611 612
612 // Installs the persistent extension preferences into |prefs_|'s extension 613 // Installs the persistent extension preferences into |prefs_|'s extension
613 // pref store. Does nothing if extensions_disabled_ is true. 614 // pref store. Does nothing if extensions_disabled_ is true.
614 void InitPrefStore(); 615 void InitPrefStore();
615 616
616 // Migrates the permissions data in the pref store. 617 // Migrates the permissions data in the pref store.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 bool extensions_disabled_; 682 bool extensions_disabled_;
682 683
683 ObserverList<ExtensionPrefsObserver> observer_list_; 684 ObserverList<ExtensionPrefsObserver> observer_list_;
684 685
685 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); 686 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs);
686 }; 687 };
687 688
688 } // namespace extensions 689 } // namespace extensions
689 690
690 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ 691 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | extensions/browser/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698