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

Side by Side Diff: chrome/browser/extensions/extension_prefs.cc

Issue 6324004: Made return types of various Value::DeepCopy() implementations more specific (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test for covariant return types Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 DCHECK(!FilePath(path_string).IsAbsolute()); 233 DCHECK(!FilePath(path_string).IsAbsolute());
234 extension_dict->SetString( 234 extension_dict->SetString(
235 kPrefPath, install_directory_.Append(path_string).value()); 235 kPrefPath, install_directory_.Append(path_string).value());
236 } 236 }
237 } 237 }
238 238
239 DictionaryValue* ExtensionPrefs::CopyCurrentExtensions() { 239 DictionaryValue* ExtensionPrefs::CopyCurrentExtensions() {
240 const DictionaryValue* extensions = prefs_->GetDictionary(kExtensionsPref); 240 const DictionaryValue* extensions = prefs_->GetDictionary(kExtensionsPref);
241 if (extensions) { 241 if (extensions) {
242 DictionaryValue* copy = 242 DictionaryValue* copy = extensions->DeepCopy();
243 static_cast<DictionaryValue*>(extensions->DeepCopy());
244 MakePathsAbsolute(copy); 243 MakePathsAbsolute(copy);
245 return copy; 244 return copy;
246 } 245 }
247 return new DictionaryValue; 246 return new DictionaryValue;
248 } 247 }
249 248
250 bool ExtensionPrefs::ReadBooleanFromPref( 249 bool ExtensionPrefs::ReadBooleanFromPref(
251 DictionaryValue* ext, const std::string& pref_key) { 250 DictionaryValue* ext, const std::string& pref_key) {
252 bool bool_value = false; 251 bool bool_value = false;
253 if (!ext->GetBoolean(pref_key, &bool_value)) 252 if (!ext->GetBoolean(pref_key, &bool_value))
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) { 1300 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) {
1302 prefs->RegisterDictionaryPref(kExtensionsPref); 1301 prefs->RegisterDictionaryPref(kExtensionsPref);
1303 prefs->RegisterListPref(kExtensionToolbar); 1302 prefs->RegisterListPref(kExtensionToolbar);
1304 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1); 1303 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1);
1305 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate); 1304 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate);
1306 prefs->RegisterListPref(prefs::kExtensionInstallAllowList); 1305 prefs->RegisterListPref(prefs::kExtensionInstallAllowList);
1307 prefs->RegisterListPref(prefs::kExtensionInstallDenyList); 1306 prefs->RegisterListPref(prefs::kExtensionInstallDenyList);
1308 prefs->RegisterListPref(prefs::kExtensionInstallForceList); 1307 prefs->RegisterListPref(prefs::kExtensionInstallForceList);
1309 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */); 1308 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */);
1310 } 1309 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function.cc ('k') | chrome/browser/extensions/external_pref_extension_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698