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

Side by Side Diff: chrome/installer/util/google_chrome_distribution.cc

Issue 3057033: Remove GetSwitchValue() from chrome/* where easy. (Closed)
Patch Set: finally Created 10 years, 4 months 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This file defines specific implementation of BrowserDistribution class for 5 // This file defines specific implementation of BrowserDistribution class for
6 // Google Chrome. 6 // Google Chrome.
7 7
8 #include "chrome/installer/util/google_chrome_distribution.h" 8 #include "chrome/installer/util/google_chrome_distribution.h"
9 9
10 #include <windows.h> 10 #include <windows.h>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 GetSystemTimeAsFileTime(&time); 122 GetSystemTimeAsFileTime(&time);
123 int now_time = FileTimeToHours(time); 123 int now_time = FileTimeToHours(time);
124 if (dir_time >= now_time) 124 if (dir_time >= now_time)
125 return 0; 125 return 0;
126 return (now_time - dir_time); 126 return (now_time - dir_time);
127 } 127 }
128 128
129 // Launches again this same process with switch --|flag|=|value|. 129 // Launches again this same process with switch --|flag|=|value|.
130 // If system_level_toast is true, appends --system-level-toast. 130 // If system_level_toast is true, appends --system-level-toast.
131 // Does not wait for the process to terminate. 131 // Does not wait for the process to terminate.
132 bool RelaunchSetup(const std::wstring& flag, int value, 132 bool RelaunchSetup(const std::string& flag, int value,
133 bool system_level_toast) { 133 bool system_level_toast) {
134 CommandLine cmd_line(CommandLine::ForCurrentProcess()->GetProgram()); 134 CommandLine cmd_line(CommandLine::ForCurrentProcess()->GetProgram());
135 cmd_line.AppendSwitchASCII(WideToASCII(flag), base::IntToString(value)); 135 cmd_line.AppendSwitchASCII(flag, base::IntToString(value));
136 if (system_level_toast) 136 if (system_level_toast)
137 cmd_line.AppendSwitch( 137 cmd_line.AppendSwitch(
138 WideToASCII(installer_util::switches::kSystemLevelToast)); 138 WideToASCII(installer_util::switches::kSystemLevelToast));
139 return base::LaunchApp(cmd_line, false, false, NULL); 139 return base::LaunchApp(cmd_line, false, false, NULL);
140 } 140 }
141 141
142 // For System level installs, setup.exe lives in the system temp, which 142 // For System level installs, setup.exe lives in the system temp, which
143 // is normally c:\windows\temp. In many cases files inside this folder 143 // is normally c:\windows\temp. In many cases files inside this folder
144 // are not accessible for execution by regular user accounts. 144 // are not accessible for execution by regular user accounts.
145 // This function changes the permisions so that any authenticated user 145 // This function changes the permisions so that any authenticated user
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 GoogleUpdateSettings::SetClient(GetExperimentGroup(outcome, flavor)); 589 GoogleUpdateSettings::SetClient(GetExperimentGroup(outcome, flavor));
590 if (outcome != kToastExpUninstallGroup) 590 if (outcome != kToastExpUninstallGroup)
591 return; 591 return;
592 // The user wants to uninstall. This is a best effort operation. Note that 592 // The user wants to uninstall. This is a best effort operation. Note that
593 // we waited for chrome to exit so the uninstall would not detect chrome 593 // we waited for chrome to exit so the uninstall would not detect chrome
594 // running. 594 // running.
595 base::LaunchApp(InstallUtil::GetChromeUninstallCmd(system_install), 595 base::LaunchApp(InstallUtil::GetChromeUninstallCmd(system_install),
596 false, false, NULL); 596 false, false, NULL);
597 } 597 }
598 #endif 598 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698