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