| OLD | NEW |
| 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 "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "base/chromeos/chromeos_version.h" | 10 #include "base/chromeos/chromeos_version.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 ::switches::kDisableForceCompositingMode, | 76 ::switches::kDisableForceCompositingMode, |
| 77 ::switches::kDisableGpuWatchdog, | 77 ::switches::kDisableGpuWatchdog, |
| 78 ::switches::kDisableLoginAnimations, | 78 ::switches::kDisableLoginAnimations, |
| 79 ::switches::kDisableNonuniformGpuMemPolicy, | 79 ::switches::kDisableNonuniformGpuMemPolicy, |
| 80 ::switches::kDisableOobeAnimation, | 80 ::switches::kDisableOobeAnimation, |
| 81 ::switches::kDisablePanelFitting, | 81 ::switches::kDisablePanelFitting, |
| 82 ::switches::kDisableThreadedCompositing, | 82 ::switches::kDisableThreadedCompositing, |
| 83 ::switches::kDisableSeccompFilterSandbox, | 83 ::switches::kDisableSeccompFilterSandbox, |
| 84 ::switches::kDisableSeccompSandbox, | 84 ::switches::kDisableSeccompSandbox, |
| 85 ::switches::kEnableAcceleratedOverflowScroll, | 85 ::switches::kEnableAcceleratedOverflowScroll, |
| 86 ::switches::kEnableBrowserPluginCompositing, | |
| 87 ::switches::kEnableCompositingForFixedPosition, | 86 ::switches::kEnableCompositingForFixedPosition, |
| 88 ::switches::kEnableGestureTapHighlight, | 87 ::switches::kEnableGestureTapHighlight, |
| 89 ::switches::kEnableLogging, | 88 ::switches::kEnableLogging, |
| 90 ::switches::kEnablePinch, | 89 ::switches::kEnablePinch, |
| 91 ::switches::kEnableViewport, | 90 ::switches::kEnableViewport, |
| 92 ::switches::kForceDeviceScaleFactor, | 91 ::switches::kForceDeviceScaleFactor, |
| 93 ::switches::kGpuStartupDialog, | 92 ::switches::kGpuStartupDialog, |
| 94 ::switches::kHasChromeOSDiamondKey, | 93 ::switches::kHasChromeOSDiamondKey, |
| 95 ::switches::kHasChromeOSKeyboard, | 94 ::switches::kHasChromeOSKeyboard, |
| 96 ::switches::kLoginProfile, | 95 ::switches::kLoginProfile, |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 base_command_line, | 276 base_command_line, |
| 278 otr_switches, | 277 otr_switches, |
| 279 command_line); | 278 command_line); |
| 280 } | 279 } |
| 281 | 280 |
| 282 std::string GetKioskAppCommandLine(const std::string& app_id) { | 281 std::string GetKioskAppCommandLine(const std::string& app_id) { |
| 283 base::DictionaryValue app_switches; | 282 base::DictionaryValue app_switches; |
| 284 app_switches.SetString(::switches::kForceAppMode, std::string()); | 283 app_switches.SetString(::switches::kForceAppMode, std::string()); |
| 285 app_switches.SetString(::switches::kAppId, app_id); | 284 app_switches.SetString(::switches::kAppId, app_id); |
| 286 app_switches.SetString(::switches::kLoginUser, std::string()); | 285 app_switches.SetString(::switches::kLoginUser, std::string()); |
| 287 // TODO(zelidrag): Move the next switch to /sbin/session_manager_setup.sh | |
| 288 // instead once http://crbug.com/179256 is resolved. | |
| 289 app_switches.SetString(::switches::kEnableBrowserPluginCompositing, | |
| 290 std::string()); | |
| 291 | 286 |
| 292 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 287 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
| 293 CommandLine new_command_line(browser_command_line.GetProgram()); | 288 CommandLine new_command_line(browser_command_line.GetProgram()); |
| 294 return DeriveCommandLine(GURL(), | 289 return DeriveCommandLine(GURL(), |
| 295 browser_command_line, | 290 browser_command_line, |
| 296 app_switches, | 291 app_switches, |
| 297 &new_command_line); | 292 &new_command_line); |
| 298 } | 293 } |
| 299 | 294 |
| 300 void RestartChrome(const std::string& command_line) { | 295 void RestartChrome(const std::string& command_line) { |
| 301 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 296 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 302 | 297 |
| 303 static bool restart_requested = false; | 298 static bool restart_requested = false; |
| 304 if (restart_requested) { | 299 if (restart_requested) { |
| 305 NOTREACHED() << "Request chrome restart for more than once."; | 300 NOTREACHED() << "Request chrome restart for more than once."; |
| 306 } | 301 } |
| 307 restart_requested = true; | 302 restart_requested = true; |
| 308 | 303 |
| 309 if (!base::chromeos::IsRunningOnChromeOS()) { | 304 if (!base::chromeos::IsRunningOnChromeOS()) { |
| 310 // Relaunch chrome without session manager on dev box. | 305 // Relaunch chrome without session manager on dev box. |
| 311 ReLaunch(command_line); | 306 ReLaunch(command_line); |
| 312 return; | 307 return; |
| 313 } | 308 } |
| 314 | 309 |
| 315 // ChromeRestartRequest deletes itself after request sent to session manager. | 310 // ChromeRestartRequest deletes itself after request sent to session manager. |
| 316 (new ChromeRestartRequest(command_line))->Start(); | 311 (new ChromeRestartRequest(command_line))->Start(); |
| 317 } | 312 } |
| 318 | 313 |
| 319 } // namespace chromeos | 314 } // namespace chromeos |
| OLD | NEW |