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

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: improve comments 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
Index: chrome/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 96e497f2e1bc8e913d696b887332ed2f4ae45811..0a353444fddcf5d57cc5dcc96535eac26a41a43f 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -613,32 +613,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;
Aaron Boodman 2010/12/03 21:50:27 please initialize primitives
gfeher 2010/12/06 16:21:26 Done.
+ return extension->GetInteger(kPrefState, &state) &&
+ state == static_cast<int>(Extension::KILLBIT);
}
std::vector<std::string> ExtensionPrefs::GetToolbarOrder() {

Powered by Google App Engine
This is Rietveld 408576698