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

Side by Side Diff: chrome/browser/shell_integration_win.cc

Issue 329017: Remove deprecated CommandLine(std::wstring) ctor. (Closed)
Patch Set: Created 11 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/process_singleton_win.cc ('k') | chrome/browser/user_data_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/shell_integration.h" 5 #include "chrome/browser/shell_integration.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 #include <shobjidl.h> 9 #include <shobjidl.h>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // Check in HKEY_CLASSES_ROOT that is the result of merge between 104 // Check in HKEY_CLASSES_ROOT that is the result of merge between
105 // HKLM and HKCU 105 // HKLM and HKCU
106 HKEY root_key = HKEY_CLASSES_ROOT; 106 HKEY root_key = HKEY_CLASSES_ROOT;
107 // Check <protocol>\shell\open\command 107 // Check <protocol>\shell\open\command
108 std::wstring key_path(kChromeProtocols[i] + ShellUtil::kRegShellOpen); 108 std::wstring key_path(kChromeProtocols[i] + ShellUtil::kRegShellOpen);
109 RegKey key(root_key, key_path.c_str(), KEY_READ); 109 RegKey key(root_key, key_path.c_str(), KEY_READ);
110 std::wstring value; 110 std::wstring value;
111 if (!key.Valid() || !key.ReadValue(L"", &value)) 111 if (!key.Valid() || !key.ReadValue(L"", &value))
112 return UNKNOWN_DEFAULT_BROWSER; 112 return UNKNOWN_DEFAULT_BROWSER;
113 // Need to normalize path in case it's been munged. 113 // Need to normalize path in case it's been munged.
114 CommandLine command_line(L""); 114 CommandLine command_line = CommandLine::FromString(value);
115 command_line.ParseFromString(value);
116 std::wstring short_path; 115 std::wstring short_path;
117 GetShortPathName(command_line.program().c_str(), 116 GetShortPathName(command_line.program().c_str(),
118 WriteInto(&short_path, MAX_PATH), MAX_PATH); 117 WriteInto(&short_path, MAX_PATH), MAX_PATH);
119 if ((short_path.size() != short_app_path.size()) || 118 if ((short_path.size() != short_app_path.size()) ||
120 (!std::equal(short_path.begin(), 119 (!std::equal(short_path.begin(),
121 short_path.end(), 120 short_path.end(),
122 short_app_path.begin(), 121 short_app_path.begin(),
123 CaseInsensitiveCompare<wchar_t>()))) 122 CaseInsensitiveCompare<wchar_t>())))
124 return NOT_DEFAULT_BROWSER; 123 return NOT_DEFAULT_BROWSER;
125 } 124 }
(...skipping 24 matching lines...) Expand all
150 std::wstring key_path(L"http"); 149 std::wstring key_path(L"http");
151 key_path.append(ShellUtil::kRegShellOpen); 150 key_path.append(ShellUtil::kRegShellOpen);
152 RegKey key(HKEY_CLASSES_ROOT, key_path.c_str(), KEY_READ); 151 RegKey key(HKEY_CLASSES_ROOT, key_path.c_str(), KEY_READ);
153 std::wstring app_cmd; 152 std::wstring app_cmd;
154 if (key.Valid() && key.ReadValue(L"", &app_cmd) && 153 if (key.Valid() && key.ReadValue(L"", &app_cmd) &&
155 std::wstring::npos != StringToLowerASCII(app_cmd).find(L"firefox")) 154 std::wstring::npos != StringToLowerASCII(app_cmd).find(L"firefox"))
156 ff_default = true; 155 ff_default = true;
157 } 156 }
158 return ff_default; 157 return ff_default;
159 } 158 }
OLDNEW
« no previous file with comments | « chrome/browser/process_singleton_win.cc ('k') | chrome/browser/user_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698