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

Side by Side Diff: chrome/browser/chromeos/login/chrome_restart_request.cc

Issue 819133004: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/login/chrome_restart_request.h" 5 #include "chrome/browser/chromeos/login/chrome_restart_request.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 const char kGuestModeLoggingLevel[] = "1"; 59 const char kGuestModeLoggingLevel[] = "1";
60 60
61 // Format of command line switch. 61 // Format of command line switch.
62 const char kSwitchFormatString[] = " --%s=\"%s\""; 62 const char kSwitchFormatString[] = " --%s=\"%s\"";
63 63
64 // Derives the new command line from |base_command_line| by doing the following: 64 // Derives the new command line from |base_command_line| by doing the following:
65 // - Forward a given switches list to new command; 65 // - Forward a given switches list to new command;
66 // - Set start url if given; 66 // - Set start url if given;
67 // - Append/override switches using |new_switches|; 67 // - Append/override switches using |new_switches|;
68 std::string DeriveCommandLine(const GURL& start_url, 68 std::string DeriveCommandLine(const GURL& start_url,
69 const CommandLine& base_command_line, 69 const base::CommandLine& base_command_line,
70 const base::DictionaryValue& new_switches, 70 const base::DictionaryValue& new_switches,
71 CommandLine* command_line) { 71 base::CommandLine* command_line) {
72 DCHECK_NE(&base_command_line, command_line); 72 DCHECK_NE(&base_command_line, command_line);
73 73
74 static const char* const kForwardSwitches[] = { 74 static const char* const kForwardSwitches[] = {
75 ::switches::kDisableAccelerated2dCanvas, 75 ::switches::kDisableAccelerated2dCanvas,
76 ::switches::kDisableAcceleratedJpegDecoding, 76 ::switches::kDisableAcceleratedJpegDecoding,
77 ::switches::kDisableAcceleratedVideoDecode, 77 ::switches::kDisableAcceleratedVideoDecode,
78 ::switches::kDisableCastStreamingHWEncoding, 78 ::switches::kDisableCastStreamingHWEncoding,
79 ::switches::kDisableDelegatedRenderer, 79 ::switches::kDisableDelegatedRenderer,
80 ::switches::kDisableDistanceFieldText, 80 ::switches::kDisableDistanceFieldText,
81 ::switches::kDisableGpu, 81 ::switches::kDisableGpu,
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 pid_, command_line_); 336 pid_, command_line_);
337 337
338 delete this; 338 delete this;
339 } 339 }
340 340
341 } // namespace 341 } // namespace
342 342
343 std::string GetOffTheRecordCommandLine( 343 std::string GetOffTheRecordCommandLine(
344 const GURL& start_url, 344 const GURL& start_url,
345 bool is_oobe_completed, 345 bool is_oobe_completed,
346 const CommandLine& base_command_line, 346 const base::CommandLine& base_command_line,
347 CommandLine* command_line) { 347 base::CommandLine* command_line) {
348 base::DictionaryValue otr_switches; 348 base::DictionaryValue otr_switches;
349 otr_switches.SetString(switches::kGuestSession, std::string()); 349 otr_switches.SetString(switches::kGuestSession, std::string());
350 otr_switches.SetString(::switches::kIncognito, std::string()); 350 otr_switches.SetString(::switches::kIncognito, std::string());
351 otr_switches.SetString(::switches::kLoggingLevel, kGuestModeLoggingLevel); 351 otr_switches.SetString(::switches::kLoggingLevel, kGuestModeLoggingLevel);
352 otr_switches.SetString(switches::kLoginUser, chromeos::login::kGuestUserName); 352 otr_switches.SetString(switches::kLoginUser, chromeos::login::kGuestUserName);
353 353
354 // Override the home page. 354 // Override the home page.
355 otr_switches.SetString(::switches::kHomePage, 355 otr_switches.SetString(::switches::kHomePage,
356 GURL(chrome::kChromeUINewTabURL).spec()); 356 GURL(chrome::kChromeUINewTabURL).spec());
357 357
(...skipping 23 matching lines...) Expand all
381 // Relaunch chrome without session manager on dev box. 381 // Relaunch chrome without session manager on dev box.
382 ReLaunch(command_line); 382 ReLaunch(command_line);
383 return; 383 return;
384 } 384 }
385 385
386 // ChromeRestartRequest deletes itself after request sent to session manager. 386 // ChromeRestartRequest deletes itself after request sent to session manager.
387 (new ChromeRestartRequest(command_line))->Start(); 387 (new ChromeRestartRequest(command_line))->Start();
388 } 388 }
389 389
390 } // namespace chromeos 390 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698