Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/extensions/extension_prefs.h" | 5 #include "chrome/browser/extensions/extension_prefs.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/extension_pref_store.h" | 10 #include "chrome/browser/extensions/extension_pref_store.h" |
| (...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1137 int64 install_time_i64 = 0; | 1137 int64 install_time_i64 = 0; |
| 1138 if (!base::StringToInt64(install_time_str, &install_time_i64)) | 1138 if (!base::StringToInt64(install_time_str, &install_time_i64)) |
| 1139 return base::Time(); | 1139 return base::Time(); |
| 1140 return base::Time::FromInternalValue(install_time_i64); | 1140 return base::Time::FromInternalValue(install_time_i64); |
| 1141 } | 1141 } |
| 1142 | 1142 |
| 1143 void ExtensionPrefs::GetExtensions(ExtensionIdSet* out) const { | 1143 void ExtensionPrefs::GetExtensions(ExtensionIdSet* out) const { |
| 1144 CHECK(out); | 1144 CHECK(out); |
| 1145 const DictionaryValue* extensions = | 1145 const DictionaryValue* extensions = |
| 1146 pref_service()->GetDictionary(kExtensionsPref); | 1146 pref_service()->GetDictionary(kExtensionsPref); |
| 1147 if (!extensions) | |
| 1148 return; | |
|
Mattias Nissler (ping if slow)
2011/01/28 09:27:03
Hm. I'd say that the problem is really with the Pr
Aaron Boodman
2011/01/29 19:24:04
cpu, did you find a case of this actually returnin
| |
| 1147 | 1149 |
| 1148 for (DictionaryValue::key_iterator ext_id = extensions->begin_keys(); | 1150 for (DictionaryValue::key_iterator ext_id = extensions->begin_keys(); |
| 1149 ext_id != extensions->end_keys(); ++ext_id) { | 1151 ext_id != extensions->end_keys(); ++ext_id) { |
| 1150 out->push_back(*ext_id); | 1152 out->push_back(*ext_id); |
| 1151 } | 1153 } |
| 1152 } | 1154 } |
| 1153 | 1155 |
| 1154 void ExtensionPrefs::FixMissingPrefs(const ExtensionIdSet& extension_ids) { | 1156 void ExtensionPrefs::FixMissingPrefs(const ExtensionIdSet& extension_ids) { |
| 1155 // Fix old entries that did not get an installation time entry when they | 1157 // Fix old entries that did not get an installation time entry when they |
| 1156 // were installed or don't have a preferences field. | 1158 // were installed or don't have a preferences field. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1245 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) { | 1247 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) { |
| 1246 prefs->RegisterDictionaryPref(kExtensionsPref); | 1248 prefs->RegisterDictionaryPref(kExtensionsPref); |
| 1247 prefs->RegisterListPref(kExtensionToolbar); | 1249 prefs->RegisterListPref(kExtensionToolbar); |
| 1248 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1); | 1250 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1); |
| 1249 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate); | 1251 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate); |
| 1250 prefs->RegisterListPref(prefs::kExtensionInstallAllowList); | 1252 prefs->RegisterListPref(prefs::kExtensionInstallAllowList); |
| 1251 prefs->RegisterListPref(prefs::kExtensionInstallDenyList); | 1253 prefs->RegisterListPref(prefs::kExtensionInstallDenyList); |
| 1252 prefs->RegisterListPref(prefs::kExtensionInstallForceList); | 1254 prefs->RegisterListPref(prefs::kExtensionInstallForceList); |
| 1253 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */); | 1255 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */); |
| 1254 } | 1256 } |
| OLD | NEW |