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

Unified Diff: chrome/browser/extensions/extension_prefs.cc

Issue 5535002: Decouple killbit testing from external extension providers (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extensions_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 07195e42e189765006377726e936e68b8426f145..d3b5bb7cbabd8049737c00a997d1850b23a23175 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -614,32 +614,13 @@ void ExtensionPrefs::SetLaunchType(const std::string& extension_id,
SavePrefsAndNotify();
}
-void ExtensionPrefs::GetKilledExtensionIds(std::set<std::string>* killed_ids) {
- const DictionaryValue* dict = prefs_->GetDictionary(kExtensionsPref);
- if (!dict || dict->empty())
- return;
-
- for (DictionaryValue::key_iterator i = dict->begin_keys();
- i != dict->end_keys(); ++i) {
- const std::string& key_name(*i);
- if (!Extension::IdIsValid(key_name)) {
- LOG(WARNING) << "Invalid external extension ID encountered: " << key_name;
- continue;
- }
-
- DictionaryValue* extension;
- if (!dict->GetDictionary(key_name, &extension)) {
- NOTREACHED();
- continue;
- }
-
- // Check to see if the extension has been killed.
- int state;
- if (extension->GetInteger(kPrefState, &state) &&
- state == static_cast<int>(Extension::KILLBIT)) {
- killed_ids->insert(StringToLowerASCII(key_name));
- }
- }
+bool ExtensionPrefs::IsExtensionKilled(const std::string& id) {
+ DictionaryValue* extension = GetExtensionPref(id);
+ if (!extension)
+ return false;
+ int state = 0;
+ return extension->GetInteger(kPrefState, &state) &&
+ state == static_cast<int>(Extension::KILLBIT);
}
std::vector<std::string> ExtensionPrefs::GetToolbarOrder() {
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extensions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698