From deac3e3c9a398b41e33983b0a07b15b4bdf5d1f6 Mon Sep 17 00:00:00 2001 From: "kuchhal@chromium.org" Date: Mon, 27 Oct 2008 19:32:35 +0000 Subject: Add '--' to Chrome open command line git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4016 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/installer/util/shell_util.cc | 8 ++++++-- chrome/installer/util/shell_util.h | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'chrome/installer') diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 8c1ed5c..d03d44a 100755 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -48,7 +48,7 @@ class RegistryEntry { std::wstring icon_path(chrome_exe); ShellUtil::GetChromeIcon(icon_path); std::wstring quoted_exe_path = L"\"" + chrome_exe + L"\""; - std::wstring open_cmd = quoted_exe_path + L" \"%1\""; + std::wstring open_cmd = ShellUtil::GetChromeShellOpenCmd(chrome_exe); entries.push_front(new RegistryEntry(L"Software\\Classes\\ChromeHTML", L"Chrome HTML")); @@ -191,7 +191,7 @@ bool CreateChromeRegKeysForXP(HKEY root_key, const std::wstring& chrome_exe) { std::wstring classes_path(ShellUtil::kRegClasses); std::wstring exe_name = file_util::GetFilenameFromPath(chrome_exe); - std::wstring chrome_open = L"\"" + chrome_exe + L"\" \"%1\""; + std::wstring chrome_open = ShellUtil::GetChromeShellOpenCmd(chrome_exe); std::wstring chrome_icon(chrome_exe); ShellUtil::GetChromeIcon(chrome_icon); @@ -368,6 +368,10 @@ bool ShellUtil::GetChromeIcon(std::wstring& chrome_icon) { return true; } +std::wstring ShellUtil::GetChromeShellOpenCmd(const std::wstring& chrome_exe) { + return L"\"" + chrome_exe + L"\" -- \"%1\""; +} + bool ShellUtil::GetChromeShortcutName(std::wstring* shortcut) { BrowserDistribution* dist = BrowserDistribution::GetDistribution(); shortcut->assign(dist->GetApplicationName()); diff --git a/chrome/installer/util/shell_util.h b/chrome/installer/util/shell_util.h index 4bb01c8..bdf77a19 100644 --- a/chrome/installer/util/shell_util.h +++ b/chrome/installer/util/shell_util.h @@ -122,6 +122,11 @@ class ShellUtil { // chrome_icon: full path to chrome.exe. static bool GetChromeIcon(std::wstring& chrome_icon); + // This method returns the command to open URLs/files using chrome. Typically + // this command is written to the registry under shell\open\command key. + // chrome_exe: the full path to chrome.exe + static std::wstring GetChromeShellOpenCmd(const std::wstring& chrome_exe); + // Returns the localized name of Chrome shortcut. static bool GetChromeShortcutName(std::wstring* shortcut); -- cgit v1.1