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

Side by Side Diff: cloud_print/service/win/chrome_launcher.cc

Issue 21150006: Introduce --cancel-first-run and reduce the strength of --no-first-run. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add first_run::IsFirstRunSuppressed() Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "cloud_print/service/win/chrome_launcher.h" 5 #include "cloud_print/service/win/chrome_launcher.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 cmd.AppendSwitch(switches::kNoServiceAutorun); 227 cmd.AppendSwitch(switches::kNoServiceAutorun);
228 228
229 // Optional. 229 // Optional.
230 cmd.AppendSwitch(switches::kAutoLaunchAtStartup); 230 cmd.AppendSwitch(switches::kAutoLaunchAtStartup);
231 cmd.AppendSwitch(switches::kDisableBackgroundMode); 231 cmd.AppendSwitch(switches::kDisableBackgroundMode);
232 cmd.AppendSwitch(switches::kDisableDefaultApps); 232 cmd.AppendSwitch(switches::kDisableDefaultApps);
233 cmd.AppendSwitch(switches::kDisableExtensions); 233 cmd.AppendSwitch(switches::kDisableExtensions);
234 cmd.AppendSwitch(switches::kDisableGpu); 234 cmd.AppendSwitch(switches::kDisableGpu);
235 cmd.AppendSwitch(switches::kDisableSoftwareRasterizer); 235 cmd.AppendSwitch(switches::kDisableSoftwareRasterizer);
236 cmd.AppendSwitch(switches::kDisableSync); 236 cmd.AppendSwitch(switches::kDisableSync);
237 cmd.AppendSwitch(switches::kNoFirstRun); 237 cmd.AppendSwitch(switches::kSkipFirstRun);
238 cmd.AppendSwitch(switches::kNoStartupWindow); 238 cmd.AppendSwitch(switches::kNoStartupWindow);
239 239
240 base::win::ScopedHandle chrome_handle; 240 base::win::ScopedHandle chrome_handle;
241 base::Time started = base::Time::Now(); 241 base::Time started = base::Time::Now();
242 DWORD thread_id = 0; 242 DWORD thread_id = 0;
243 LaunchProcess(cmd, chrome_handle.Receive(), &thread_id); 243 LaunchProcess(cmd, chrome_handle.Receive(), &thread_id);
244 244
245 HANDLE handles[] = {stop_event_.handle(), chrome_handle}; 245 HANDLE handles[] = {stop_event_.handle(), chrome_handle};
246 DWORD wait_result = WAIT_TIMEOUT; 246 DWORD wait_result = WAIT_TIMEOUT;
247 while (wait_result == WAIT_TIMEOUT) { 247 while (wait_result == WAIT_TIMEOUT) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 cmd.AppendSwitchPath(switches::kUserDataDir, temp_user_data.path()); 304 cmd.AppendSwitchPath(switches::kUserDataDir, temp_user_data.path());
305 cmd.AppendSwitchPath(switches::kCloudPrintSetupProxy, printers_file); 305 cmd.AppendSwitchPath(switches::kCloudPrintSetupProxy, printers_file);
306 cmd.AppendSwitch(switches::kNoServiceAutorun); 306 cmd.AppendSwitch(switches::kNoServiceAutorun);
307 307
308 // Optional. 308 // Optional.
309 cmd.AppendSwitch(switches::kDisableBackgroundMode); 309 cmd.AppendSwitch(switches::kDisableBackgroundMode);
310 cmd.AppendSwitch(switches::kDisableDefaultApps); 310 cmd.AppendSwitch(switches::kDisableDefaultApps);
311 cmd.AppendSwitch(switches::kDisableExtensions); 311 cmd.AppendSwitch(switches::kDisableExtensions);
312 cmd.AppendSwitch(switches::kDisableSync); 312 cmd.AppendSwitch(switches::kDisableSync);
313 cmd.AppendSwitch(switches::kNoDefaultBrowserCheck); 313 cmd.AppendSwitch(switches::kNoDefaultBrowserCheck);
314 cmd.AppendSwitch(switches::kNoFirstRun); 314 cmd.AppendSwitch(switches::kSkipFirstRun);
315 315
316 cmd.AppendArg(GetCloudPrintServiceEnableURLWithSignin(proxy_id).spec()); 316 cmd.AppendArg(GetCloudPrintServiceEnableURLWithSignin(proxy_id).spec());
317 317
318 base::win::ScopedHandle chrome_handle; 318 base::win::ScopedHandle chrome_handle;
319 DWORD thread_id = 0; 319 DWORD thread_id = 0;
320 if (!LaunchProcess(cmd, chrome_handle.Receive(), &thread_id)) { 320 if (!LaunchProcess(cmd, chrome_handle.Receive(), &thread_id)) {
321 LOG(ERROR) << "Unable to launch Chrome."; 321 LOG(ERROR) << "Unable to launch Chrome.";
322 return result; 322 return result;
323 } 323 }
324 324
(...skipping 12 matching lines...) Expand all
337 } 337 }
338 } else { 338 } else {
339 LOG(ERROR) << "Chrome launch failed."; 339 LOG(ERROR) << "Chrome launch failed.";
340 return result; 340 return result;
341 } 341 }
342 } 342 }
343 NOTREACHED(); 343 NOTREACHED();
344 return std::string(); 344 return std::string();
345 } 345 }
346 346
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698