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

Unified Diff: chrome/browser/profile_manager.h

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/page_state.cc ('k') | chrome/browser/safe_browsing/safe_browsing_blocking_page.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile_manager.h
===================================================================
--- chrome/browser/profile_manager.h (revision 10828)
+++ chrome/browser/profile_manager.h (working copy)
@@ -15,6 +15,7 @@
#include "base/file_path.h"
#include "base/message_loop.h"
#include "base/non_thread_safe.h"
+#include "base/string_util.h"
#include "base/system_monitor.h"
#include "base/values.h"
#include "chrome/browser/profile.h"
@@ -33,20 +34,21 @@
// Decodes a DictionaryValue into an AvailableProfile
static AvailableProfile* FromValue(DictionaryValue* value) {
DCHECK(value);
- std::wstring name, id;
+ string16 name, id;
FilePath::StringType directory;
- value->GetString(L"name", &name);
- value->GetString(L"id", &id);
- value->GetString(L"directory", &directory);
- return new AvailableProfile(name, id, FilePath(directory));
+ value->GetString(ASCIIToUTF16("name"), &name);
+ value->GetString(ASCIIToUTF16("id"), &id);
+ value->GetString(ASCIIToUTF16("directory"), &directory);
+ return new AvailableProfile(UTF16ToWideHack(name), UTF16ToWideHack(id),
+ FilePath(directory));
}
// Encodes this AvailableProfile into a new DictionaryValue
DictionaryValue* ToValue() {
DictionaryValue* value = new DictionaryValue;
- value->SetString(L"name", name_);
- value->SetString(L"id", id_);
- value->SetString(L"directory", directory_.value());
+ value->SetString(ASCIIToUTF16("name"), WideToUTF16Hack(name_));
+ value->SetString(ASCIIToUTF16("id"), WideToUTF16Hack(id_));
+ value->SetString(ASCIIToUTF16("directory"), directory_.value());
return value;
}
@@ -183,4 +185,3 @@
};
#endif // CHROME_BROWSER_PROFILE_MANAGER_H__
-
« no previous file with comments | « chrome/browser/page_state.cc ('k') | chrome/browser/safe_browsing/safe_browsing_blocking_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698