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

Unified Diff: chrome/browser/importer/importer.cc

Issue 31014: Port DictionaryValue to use string16 instead of wstring. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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/browser/extensions/extensions_ui.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/importer.cc
===================================================================
--- chrome/browser/importer/importer.cc (revision 10828)
+++ chrome/browser/importer/importer.cc (working copy)
@@ -658,25 +658,24 @@
std::wstring source_path;
for (int i = 0; ; ++i) {
- std::wstring current_profile = L"Profile" + IntToWString(i);
+ string16 current_profile = ASCIIToUTF16("Profile") + IntToString16(i);
if (!root.HasKey(current_profile)) {
// Profiles are continuously numbered. So we exit when we can't
// find the i-th one.
break;
}
- std::wstring is_relative, path, profile_path;
- if (root.GetString(current_profile + L".IsRelative", &is_relative) &&
- root.GetString(current_profile + L".Path", &path)) {
- string16 path16 = WideToUTF16Hack(path);
+ string16 is_relative, path, profile_path;
+ if (root.GetString(current_profile + ASCIIToUTF16(".IsRelative"),
+ &is_relative) &&
+ root.GetString(current_profile + ASCIIToUTF16(".Path"), &path)) {
ReplaceSubstringsAfterOffset(
- &path16, 0, ASCIIToUTF16("/"), ASCIIToUTF16("\\"));
- path.assign(UTF16ToWideHack(path16));
+ &path, 0, ASCIIToUTF16("/"), ASCIIToUTF16("\\"));
#if defined(OS_WIN)
// IsRelative=1 means the folder path would be relative to the
// path of profiles.ini. IsRelative=0 refers to a custom profile
// location.
- if (is_relative == L"1") {
+ if (is_relative == ASCIIToUTF16("1")) {
profile_path = file_util::GetDirectoryFromPath(ini_file);
file_util::AppendToPath(&profile_path, path);
} else {
@@ -687,12 +686,13 @@
// We only import the default profile when multiple profiles exist,
// since the other profiles are used mostly by developers for testing.
// Otherwise, Profile0 will be imported.
- std::wstring is_default;
- if ((root.GetString(current_profile + L".Default", &is_default) &&
- is_default == L"1") || i == 0) {
- source_path = profile_path;
+ string16 is_default;
+ if ((root.GetString(current_profile + ASCIIToUTF16(".Default"),
+ &is_default) &&
+ is_default == ASCIIToUTF16("1")) || i == 0) {
+ source_path = UTF16ToWideHack(profile_path);
// We break out of the loop when we have found the default profile.
- if (is_default == L"1")
+ if (is_default == ASCIIToUTF16("1"))
break;
}
}
« no previous file with comments | « chrome/browser/extensions/extensions_ui.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698