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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 CommandLine* command_line) { | 65 CommandLine* command_line) { |
66 DCHECK_NE(&base_command_line, command_line); | 66 DCHECK_NE(&base_command_line, command_line); |
67 | 67 |
68 static const char* kForwardSwitches[] = { | 68 static const char* kForwardSwitches[] = { |
69 ::switches::kAllowWebUICompositing, | 69 ::switches::kAllowWebUICompositing, |
70 ::switches::kDeviceManagementUrl, | 70 ::switches::kDeviceManagementUrl, |
71 ::switches::kDisableAccelerated2dCanvas, | 71 ::switches::kDisableAccelerated2dCanvas, |
72 ::switches::kDisableAcceleratedOverflowScroll, | 72 ::switches::kDisableAcceleratedOverflowScroll, |
73 ::switches::kDisableAcceleratedPlugins, | 73 ::switches::kDisableAcceleratedPlugins, |
74 ::switches::kDisableAcceleratedVideoDecode, | 74 ::switches::kDisableAcceleratedVideoDecode, |
| 75 ::switches::kDisableBrowserPluginCompositing, |
75 ::switches::kDisableEncryptedMedia, | 76 ::switches::kDisableEncryptedMedia, |
76 ::switches::kDisableForceCompositingMode, | 77 ::switches::kDisableForceCompositingMode, |
77 ::switches::kDisableGpuWatchdog, | 78 ::switches::kDisableGpuWatchdog, |
78 ::switches::kDisableLoginAnimations, | 79 ::switches::kDisableLoginAnimations, |
79 ::switches::kDisableNonuniformGpuMemPolicy, | 80 ::switches::kDisableNonuniformGpuMemPolicy, |
80 ::switches::kDisableOobeAnimation, | 81 ::switches::kDisableOobeAnimation, |
81 ::switches::kDisablePanelFitting, | 82 ::switches::kDisablePanelFitting, |
82 ::switches::kDisableThreadedCompositing, | 83 ::switches::kDisableThreadedCompositing, |
83 ::switches::kDisableSeccompFilterSandbox, | 84 ::switches::kDisableSeccompFilterSandbox, |
84 ::switches::kDisableSeccompSandbox, | 85 ::switches::kDisableSeccompSandbox, |
85 ::switches::kEnableAcceleratedOverflowScroll, | 86 ::switches::kEnableAcceleratedOverflowScroll, |
86 ::switches::kEnableBrowserPluginCompositing, | |
87 ::switches::kEnableCompositingForFixedPosition, | 87 ::switches::kEnableCompositingForFixedPosition, |
88 ::switches::kEnableGestureTapHighlight, | 88 ::switches::kEnableGestureTapHighlight, |
89 ::switches::kEnableLogging, | 89 ::switches::kEnableLogging, |
90 ::switches::kEnablePinch, | 90 ::switches::kEnablePinch, |
91 ::switches::kEnableViewport, | 91 ::switches::kEnableViewport, |
92 ::switches::kForceDeviceScaleFactor, | 92 ::switches::kForceDeviceScaleFactor, |
93 ::switches::kGpuStartupDialog, | 93 ::switches::kGpuStartupDialog, |
94 ::switches::kHasChromeOSDiamondKey, | 94 ::switches::kHasChromeOSDiamondKey, |
95 ::switches::kHasChromeOSKeyboard, | 95 ::switches::kHasChromeOSKeyboard, |
96 ::switches::kLoginProfile, | 96 ::switches::kLoginProfile, |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 base_command_line, | 277 base_command_line, |
278 otr_switches, | 278 otr_switches, |
279 command_line); | 279 command_line); |
280 } | 280 } |
281 | 281 |
282 std::string GetKioskAppCommandLine(const std::string& app_id) { | 282 std::string GetKioskAppCommandLine(const std::string& app_id) { |
283 base::DictionaryValue app_switches; | 283 base::DictionaryValue app_switches; |
284 app_switches.SetString(::switches::kForceAppMode, std::string()); | 284 app_switches.SetString(::switches::kForceAppMode, std::string()); |
285 app_switches.SetString(::switches::kAppId, app_id); | 285 app_switches.SetString(::switches::kAppId, app_id); |
286 app_switches.SetString(::switches::kLoginUser, std::string()); | 286 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 | 287 |
292 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 288 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
293 CommandLine new_command_line(browser_command_line.GetProgram()); | 289 CommandLine new_command_line(browser_command_line.GetProgram()); |
294 return DeriveCommandLine(GURL(), | 290 return DeriveCommandLine(GURL(), |
295 browser_command_line, | 291 browser_command_line, |
296 app_switches, | 292 app_switches, |
297 &new_command_line); | 293 &new_command_line); |
298 } | 294 } |
299 | 295 |
300 void RestartChrome(const std::string& command_line) { | 296 void RestartChrome(const std::string& command_line) { |
301 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 297 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
302 | 298 |
303 static bool restart_requested = false; | 299 static bool restart_requested = false; |
304 if (restart_requested) { | 300 if (restart_requested) { |
305 NOTREACHED() << "Request chrome restart for more than once."; | 301 NOTREACHED() << "Request chrome restart for more than once."; |
306 } | 302 } |
307 restart_requested = true; | 303 restart_requested = true; |
308 | 304 |
309 if (!base::chromeos::IsRunningOnChromeOS()) { | 305 if (!base::chromeos::IsRunningOnChromeOS()) { |
310 // Relaunch chrome without session manager on dev box. | 306 // Relaunch chrome without session manager on dev box. |
311 ReLaunch(command_line); | 307 ReLaunch(command_line); |
312 return; | 308 return; |
313 } | 309 } |
314 | 310 |
315 // ChromeRestartRequest deletes itself after request sent to session manager. | 311 // ChromeRestartRequest deletes itself after request sent to session manager. |
316 (new ChromeRestartRequest(command_line))->Start(); | 312 (new ChromeRestartRequest(command_line))->Start(); |
317 } | 313 } |
318 | 314 |
319 } // namespace chromeos | 315 } // namespace chromeos |
OLD | NEW |