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