| 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 cc::switches::kDisableCompositedAntialiasing, | 170 cc::switches::kDisableCompositedAntialiasing, |
| 171 cc::switches::kDisableCompositorTouchHitTesting, | 171 cc::switches::kDisableCompositorTouchHitTesting, |
| 172 cc::switches::kDisableGPURasterization, | 172 cc::switches::kDisableGPURasterization, |
| 173 cc::switches::kDisableImplSidePainting, | 173 cc::switches::kDisableImplSidePainting, |
| 174 cc::switches::kDisableMapImage, | 174 cc::switches::kDisableMapImage, |
| 175 cc::switches::kDisableThreadedAnimation, | 175 cc::switches::kDisableThreadedAnimation, |
| 176 cc::switches::kEnableGpuBenchmarking, | 176 cc::switches::kEnableGpuBenchmarking, |
| 177 cc::switches::kEnableGPURasterization, | 177 cc::switches::kEnableGPURasterization, |
| 178 cc::switches::kEnableImplSidePainting, | 178 cc::switches::kEnableImplSidePainting, |
| 179 cc::switches::kEnableMapImage, | 179 cc::switches::kEnableMapImage, |
| 180 cc::switches::kEnablePartialSwap, | |
| 181 cc::switches::kEnablePinchVirtualViewport, | 180 cc::switches::kEnablePinchVirtualViewport, |
| 182 cc::switches::kEnableTopControlsPositionCalculation, | 181 cc::switches::kEnableTopControlsPositionCalculation, |
| 183 cc::switches::kMaxTilesForInterestArea, | 182 cc::switches::kMaxTilesForInterestArea, |
| 184 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, | 183 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, |
| 185 cc::switches::kShowCompositedLayerBorders, | 184 cc::switches::kShowCompositedLayerBorders, |
| 186 cc::switches::kShowFPSCounter, | 185 cc::switches::kShowFPSCounter, |
| 187 cc::switches::kShowLayerAnimationBounds, | 186 cc::switches::kShowLayerAnimationBounds, |
| 188 cc::switches::kShowNonOccludingRects, | 187 cc::switches::kShowNonOccludingRects, |
| 189 cc::switches::kShowOccludingRects, | 188 cc::switches::kShowOccludingRects, |
| 190 cc::switches::kShowPropertyChangedRects, | 189 cc::switches::kShowPropertyChangedRects, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // Copying switches won't be needed when Guest mode won't need restart | 227 // Copying switches won't be needed when Guest mode won't need restart |
| 229 // http://crosbug.com/6924 | 228 // http://crosbug.com/6924 |
| 230 if (base_command_line.HasSwitch(::switches::kRegisterPepperPlugins)) { | 229 if (base_command_line.HasSwitch(::switches::kRegisterPepperPlugins)) { |
| 231 cmd_line_str += base::StringPrintf( | 230 cmd_line_str += base::StringPrintf( |
| 232 kSwitchFormatString, | 231 kSwitchFormatString, |
| 233 ::switches::kRegisterPepperPlugins, | 232 ::switches::kRegisterPepperPlugins, |
| 234 base_command_line.GetSwitchValueNative( | 233 base_command_line.GetSwitchValueNative( |
| 235 ::switches::kRegisterPepperPlugins).c_str()); | 234 ::switches::kRegisterPepperPlugins).c_str()); |
| 236 } | 235 } |
| 237 | 236 |
| 238 // TODO(zelidrag): Remove this hack that get us around compositing bug from | |
| 239 // http://crbug.com/179256 once that bug is resolved. | |
| 240 if (command_line->HasSwitch(::switches::kForceAppMode)) { | |
| 241 std::string switch_to_remove("--"); | |
| 242 switch_to_remove.append(cc::switches::kEnablePartialSwap); | |
| 243 cmd_line_str = cmd_line_str.replace(cmd_line_str.find(switch_to_remove), | |
| 244 switch_to_remove.length(), ""); | |
| 245 } | |
| 246 | |
| 247 return cmd_line_str; | 237 return cmd_line_str; |
| 248 } | 238 } |
| 249 | 239 |
| 250 // Simulates a session manager restart by launching give command line | 240 // Simulates a session manager restart by launching give command line |
| 251 // and exit current process. | 241 // and exit current process. |
| 252 void ReLaunch(const std::string& command_line) { | 242 void ReLaunch(const std::string& command_line) { |
| 253 std::vector<std::string> argv; | 243 std::vector<std::string> argv; |
| 254 | 244 |
| 255 // This is not a proper way to get |argv| but it's good enough for debugging. | 245 // This is not a proper way to get |argv| but it's good enough for debugging. |
| 256 base::SplitString(command_line, ' ', &argv); | 246 base::SplitString(command_line, ' ', &argv); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 // Relaunch chrome without session manager on dev box. | 360 // Relaunch chrome without session manager on dev box. |
| 371 ReLaunch(command_line); | 361 ReLaunch(command_line); |
| 372 return; | 362 return; |
| 373 } | 363 } |
| 374 | 364 |
| 375 // ChromeRestartRequest deletes itself after request sent to session manager. | 365 // ChromeRestartRequest deletes itself after request sent to session manager. |
| 376 (new ChromeRestartRequest(command_line))->Start(); | 366 (new ChromeRestartRequest(command_line))->Start(); |
| 377 } | 367 } |
| 378 | 368 |
| 379 } // namespace chromeos | 369 } // namespace chromeos |
| OLD | NEW |