| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/shell/app/shell_main_delegate.h" | 5 #include "content/shell/app/shell_main_delegate.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return true; | 129 return true; |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 | 132 |
| 133 if (command_line.HasSwitch(switches::kDumpRenderTree)) { | 133 if (command_line.HasSwitch(switches::kDumpRenderTree)) { |
| 134 EnableBrowserLayoutTestMode(); | 134 EnableBrowserLayoutTestMode(); |
| 135 | 135 |
| 136 command_line.AppendSwitch(switches::kProcessPerTab); | 136 command_line.AppendSwitch(switches::kProcessPerTab); |
| 137 command_line.AppendSwitch(switches::kEnableLogging); | 137 command_line.AppendSwitch(switches::kEnableLogging); |
| 138 command_line.AppendSwitch(switches::kAllowFileAccessFromFiles); | 138 command_line.AppendSwitch(switches::kAllowFileAccessFromFiles); |
| 139 #if !defined(OS_ANDROID) | 139 command_line.AppendSwitchASCII(switches::kUseGL, |
| 140 // OSMesa is not yet available for Android. http://crbug.com/248925 | 140 gfx::kGLImplementationOSMesaName); |
| 141 command_line.AppendSwitchASCII( | |
| 142 switches::kUseGL, gfx::kGLImplementationOSMesaName); | |
| 143 #endif | |
| 144 command_line.AppendSwitch(switches::kSkipGpuDataLoading); | 141 command_line.AppendSwitch(switches::kSkipGpuDataLoading); |
| 145 command_line.AppendSwitchASCII(switches::kTouchEvents, | 142 command_line.AppendSwitchASCII(switches::kTouchEvents, |
| 146 switches::kTouchEventsEnabled); | 143 switches::kTouchEventsEnabled); |
| 147 command_line.AppendSwitch(switches::kEnableGestureTapHighlight); | 144 command_line.AppendSwitch(switches::kEnableGestureTapHighlight); |
| 148 command_line.AppendSwitchASCII(switches::kForceDeviceScaleFactor, "1.0"); | 145 command_line.AppendSwitchASCII(switches::kForceDeviceScaleFactor, "1.0"); |
| 149 #if defined(OS_ANDROID) | 146 #if defined(OS_ANDROID) |
| 150 command_line.AppendSwitch( | 147 command_line.AppendSwitch( |
| 151 switches::kDisableGestureRequirementForMediaPlayback); | 148 switches::kDisableGestureRequirementForMediaPlayback); |
| 152 // Capturing pixel results does not yet work when implementation-side | |
| 153 // painting is enabled. See http://crbug.com/250777 | |
| 154 command_line.AppendSwitch(cc::switches::kDisableImplSidePainting); | |
| 155 #endif | 149 #endif |
| 156 | 150 |
| 157 if (!command_line.HasSwitch(switches::kStableReleaseMode)) { | 151 if (!command_line.HasSwitch(switches::kStableReleaseMode)) { |
| 158 command_line.AppendSwitch( | 152 command_line.AppendSwitch( |
| 159 switches::kEnableExperimentalWebPlatformFeatures); | 153 switches::kEnableExperimentalWebPlatformFeatures); |
| 160 } | 154 } |
| 161 | 155 |
| 162 if (!command_line.HasSwitch(switches::kEnableThreadedCompositing)) { | 156 if (!command_line.HasSwitch(switches::kEnableThreadedCompositing)) { |
| 163 command_line.AppendSwitch(switches::kDisableThreadedCompositing); | 157 command_line.AppendSwitch(switches::kDisableThreadedCompositing); |
| 164 command_line.AppendSwitch(cc::switches::kDisableThreadedAnimation); | 158 command_line.AppendSwitch(cc::switches::kDisableThreadedAnimation); |
| 165 } | 159 } |
| 166 | 160 |
| 167 command_line.AppendSwitch(switches::kEnableInbandTextTracks); | 161 command_line.AppendSwitch(switches::kEnableInbandTextTracks); |
| 168 command_line.AppendSwitch(switches::kMuteAudio); | 162 command_line.AppendSwitch(switches::kMuteAudio); |
| 169 | 163 |
| 170 #if defined(USE_AURA) | 164 #if defined(USE_AURA) || defined(OS_ANDROID) |
| 171 // TODO: crbug.com/311404 Make layout tests work w/ delegated renderer. | 165 // TODO: crbug.com/311404 Make layout tests work w/ delegated renderer. |
| 172 command_line.AppendSwitch(switches::kDisableDelegatedRenderer); | 166 command_line.AppendSwitch(switches::kDisableDelegatedRenderer); |
| 173 #endif | 167 #endif |
| 174 | 168 |
| 175 command_line.AppendSwitch(switches::kEnableFileCookies); | 169 command_line.AppendSwitch(switches::kEnableFileCookies); |
| 176 | 170 |
| 177 // Unless/until WebM files are added to the media layout tests, we need to | 171 // Unless/until WebM files are added to the media layout tests, we need to |
| 178 // avoid removing MP4/H264/AAC so that layout tests can run on Android. | 172 // avoid removing MP4/H264/AAC so that layout tests can run on Android. |
| 179 #if !defined(OS_ANDROID) | 173 #if !defined(OS_ANDROID) |
| 180 net::RemoveProprietaryMediaTypesAndCodecsForTests(); | 174 net::RemoveProprietaryMediaTypesAndCodecsForTests(); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 browser_client_.reset(new ShellContentBrowserClient); | 285 browser_client_.reset(new ShellContentBrowserClient); |
| 292 return browser_client_.get(); | 286 return browser_client_.get(); |
| 293 } | 287 } |
| 294 | 288 |
| 295 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { | 289 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { |
| 296 renderer_client_.reset(new ShellContentRendererClient); | 290 renderer_client_.reset(new ShellContentRendererClient); |
| 297 return renderer_client_.get(); | 291 return renderer_client_.get(); |
| 298 } | 292 } |
| 299 | 293 |
| 300 } // namespace content | 294 } // namespace content |
| OLD | NEW |