diff options
author | dsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 21:49:53 +0000 |
---|---|---|
committer | dsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 21:49:53 +0000 |
commit | 3a79b3cc8393d54d72c8c7e14615fe64d86fd039 (patch) | |
tree | 2730ef27672c8f9c9e1b6ef3f443434ac98bfd4f /chrome/browser/profile_manager.h | |
parent | 1c9e90e17741f9c34f4cbe7f3e68a8300ed24e08 (diff) | |
download | chromium_src-3a79b3cc8393d54d72c8c7e14615fe64d86fd039.zip chromium_src-3a79b3cc8393d54d72c8c7e14615fe64d86fd039.tar.gz chromium_src-3a79b3cc8393d54d72c8c7e14615fe64d86fd039.tar.bz2 |
Port DictionaryValue to use string16 instead of wstring.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=10818
Review URL: http://codereview.chromium.org/31014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile_manager.h')
-rw-r--r-- | chrome/browser/profile_manager.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/profile_manager.h b/chrome/browser/profile_manager.h index 3735492..e8798a2 100644 --- a/chrome/browser/profile_manager.h +++ b/chrome/browser/profile_manager.h @@ -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 @@ class AvailableProfile { // 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 @@ class ProfileManager : public NonThreadSafe, }; #endif // CHROME_BROWSER_PROFILE_MANAGER_H__ - |