diff options
author | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-24 19:14:11 +0000 |
---|---|---|
committer | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-24 19:14:11 +0000 |
commit | efd97484dbba5faec394693002228a1f0e2c2f82 (patch) | |
tree | fcf94e84e1dc8213debb308fc4c405738eac3543 /chrome_frame/chrome_launcher_utils.cc | |
parent | 30aa3ee0461f0475180d50d4adc4b925fe7e1315 (diff) | |
download | chromium_src-efd97484dbba5faec394693002228a1f0e2c2f82.zip chromium_src-efd97484dbba5faec394693002228a1f0e2c2f82.tar.gz chromium_src-efd97484dbba5faec394693002228a1f0e2c2f82.tar.bz2 |
When changing Ready Mode state from within an IE process, use chrome_launcher to invoke the ProcessLauncher, so as to not cause a UAC prompt (chrome_launcher is permitted via elevation policy).
BUG=None
TEST=Install GCF in Ready Mode on Vista, interact with it.
Review URL: http://codereview.chromium.org/6355011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_launcher_utils.cc')
-rw-r--r-- | chrome_frame/chrome_launcher_utils.cc | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/chrome_frame/chrome_launcher_utils.cc b/chrome_frame/chrome_launcher_utils.cc index 1b5943a..83d64ed 100644 --- a/chrome_frame/chrome_launcher_utils.cc +++ b/chrome_frame/chrome_launcher_utils.cc @@ -14,16 +14,11 @@ #include "chrome/common/chrome_switches.h" #include "chrome_frame/chrome_frame_automation.h" -namespace chrome_launcher { +namespace { -const wchar_t kLauncherExeBaseName[] = L"chrome_launcher.exe"; - -CommandLine* CreateLaunchCommandLine() { - // Shortcut for OS versions that don't need the integrity broker. - if (base::win::GetVersion() < base::win::VERSION_VISTA) { - return new CommandLine(GetChromeExecutablePath()); - } +const char kUpdateCommandFlag[] = "--update-cmd"; +CommandLine* CreateChromeLauncherCommandLine() { // The launcher EXE will be in the same directory as the Chrome Frame DLL, // so create a full path to it based on this assumption. Since our unit // tests also use this function, and live in the directory above, we test @@ -32,12 +27,13 @@ CommandLine* CreateLaunchCommandLine() { FilePath module_path; if (PathService::Get(base::FILE_MODULE, &module_path)) { FilePath current_dir = module_path.DirName(); - FilePath same_dir_path = current_dir.Append(kLauncherExeBaseName); + FilePath same_dir_path = current_dir.Append( + chrome_launcher::kLauncherExeBaseName); if (file_util::PathExists(same_dir_path)) { return new CommandLine(same_dir_path); } else { - FilePath servers_path = - current_dir.Append(L"servers").Append(kLauncherExeBaseName); + FilePath servers_path = current_dir.Append(L"servers").Append( + chrome_launcher::kLauncherExeBaseName); DCHECK(file_util::PathExists(servers_path)) << "What module is this? It's not in 'servers' or main output dir."; return new CommandLine(servers_path); @@ -48,6 +44,32 @@ CommandLine* CreateLaunchCommandLine() { } } +} // namespace + +namespace chrome_launcher { + +const wchar_t kLauncherExeBaseName[] = L"chrome_launcher.exe"; + +CommandLine* CreateUpdateCommandLine(const std::wstring& update_command) { + CommandLine* command_line = CreateChromeLauncherCommandLine(); + + if (command_line) { + command_line->AppendArg(kUpdateCommandFlag); + command_line->AppendArg(WideToASCII(update_command)); + } + + return command_line; +} + +CommandLine* CreateLaunchCommandLine() { + // Shortcut for OS versions that don't need the integrity broker. + if (base::win::GetVersion() < base::win::VERSION_VISTA) { + return new CommandLine(GetChromeExecutablePath()); + } + + return CreateChromeLauncherCommandLine(); +} + FilePath GetChromeExecutablePath() { FilePath cur_path; PathService::Get(base::DIR_MODULE, &cur_path); |