diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-04 20:41:33 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-04 20:41:33 +0000 |
commit | 8a205c0f534bf8e5f17a531182dee38aaacd46e6 (patch) | |
tree | 1b1bab965f71658393dccdda1590d59711689962 /chrome/browser/process_singleton_win.cc | |
parent | 58023bea8fa444c4ac08c12c825dcc79b5954abe (diff) | |
download | chromium_src-8a205c0f534bf8e5f17a531182dee38aaacd46e6.zip chromium_src-8a205c0f534bf8e5f17a531182dee38aaacd46e6.tar.gz chromium_src-8a205c0f534bf8e5f17a531182dee38aaacd46e6.tar.bz2 |
FilePath: Remove much of ToWStringHack, adding a LossyDisplayName()
The reason we don't want a free conversion between FilePaths and Unicode
is that it can be lossy. But when displaying a string to the user,
we're ok if it's lossy when we have no other option.
This change introduces a LossyDisplayName() method that returns a
string16, and converts many of the users of ToWStringHack to use it.
BUG=69467
Review URL: http://codereview.chromium.org/6246036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73840 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton_win.cc')
-rw-r--r-- | chrome/browser/process_singleton_win.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc index 1be5a87..17910dc 100644 --- a/chrome/browser/process_singleton_win.cc +++ b/chrome/browser/process_singleton_win.cc @@ -42,10 +42,9 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) { // Look for a Chrome instance that uses the same profile directory. ProcessSingleton::ProcessSingleton(const FilePath& user_data_dir) : window_(NULL), locked_(false), foreground_window_(NULL) { - std::wstring user_data_dir_str(user_data_dir.ToWStringHack()); remote_window_ = FindWindowEx(HWND_MESSAGE, NULL, chrome::kMessageWindowClass, - user_data_dir_str.c_str()); + user_data_dir.value().c_str()); if (!remote_window_) { // Make sure we will be the one and only process creating the window. // We use a named Mutex since we are protecting against multi-process @@ -68,7 +67,7 @@ ProcessSingleton::ProcessSingleton(const FilePath& user_data_dir) // was given to us. remote_window_ = FindWindowEx(HWND_MESSAGE, NULL, chrome::kMessageWindowClass, - user_data_dir_str.c_str()); + user_data_dir.value().c_str()); if (!remote_window_) Create(); BOOL success = ReleaseMutex(only_me); |