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

Unified Diff: chrome/installer/util/master_preferences.cc

Issue 3117017: Remove deprecated wstring Get(As)String() methods from Value, etc. (Closed)
Patch Set: fix win Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/util/master_preferences.h ('k') | chrome/installer/util/master_preferences_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/master_preferences.cc
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index 293d35bed17560fc3644790db904ae559a512891..d3bd7e14e9128341c5f6e262bb8cc6d71bebb764 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,7 +14,8 @@
namespace {
-const wchar_t* kDistroDict = L"distribution";
+
+const char kDistroDict[] = "distribution";
bool GetGURLFromValue(const Value* in_value, GURL* out_value) {
if (!in_value || !out_value)
@@ -26,7 +27,7 @@ bool GetGURLFromValue(const Value* in_value, GURL* out_value) {
return true;
}
-std::vector<GURL> GetNamedList(const wchar_t* name,
+std::vector<GURL> GetNamedList(const char* name,
const DictionaryValue* prefs) {
std::vector<GURL> list;
if (!prefs)
@@ -46,12 +47,12 @@ std::vector<GURL> GetNamedList(const wchar_t* name,
return list;
}
-}
+} // namespace
namespace installer_util {
bool GetDistroBooleanPreference(const DictionaryValue* prefs,
- const std::wstring& name,
+ const std::string& name,
bool* value) {
if (!prefs || !value)
return false;
@@ -67,8 +68,8 @@ bool GetDistroBooleanPreference(const DictionaryValue* prefs,
}
bool GetDistroStringPreference(const DictionaryValue* prefs,
- const std::wstring& name,
- std::wstring* value) {
+ const std::string& name,
+ std::string* value) {
if (!prefs || !value)
return false;
@@ -76,7 +77,7 @@ bool GetDistroStringPreference(const DictionaryValue* prefs,
if (!prefs->GetDictionary(kDistroDict, &distro) || !distro)
return false;
- std::wstring str_value;
+ std::string str_value;
if (!distro->GetString(name, &str_value))
return false;
@@ -88,7 +89,7 @@ bool GetDistroStringPreference(const DictionaryValue* prefs,
}
bool GetDistroIntegerPreference(const DictionaryValue* prefs,
- const std::wstring& name,
+ const std::string& name,
int* value) {
if (!prefs || !value)
return false;
@@ -186,15 +187,15 @@ DictionaryValue* ParseDistributionPreferences(
}
std::vector<GURL> GetFirstRunTabs(const DictionaryValue* prefs) {
- return GetNamedList(L"first_run_tabs", prefs);
+ return GetNamedList("first_run_tabs", prefs);
}
bool SetDistroBooleanPreference(DictionaryValue* prefs,
- const std::wstring& name,
+ const std::string& name,
bool value) {
if (!prefs || name.empty())
return false;
- prefs->SetBoolean(std::wstring(kDistroDict) + L"." + name, value);
+ prefs->SetBoolean(std::string(kDistroDict) + "." + name, value);
return true;
}
« no previous file with comments | « chrome/installer/util/master_preferences.h ('k') | chrome/installer/util/master_preferences_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698