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 "content/child/runtime_features.h" | 5 #include "content/child/runtime_features.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
9 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 9 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 if (command_line.HasSwitch(switches::kEnableWebAnimationsCSS)) | 88 if (command_line.HasSwitch(switches::kEnableWebAnimationsCSS)) |
89 WebRuntimeFeatures::enableWebAnimationsCSS(); | 89 WebRuntimeFeatures::enableWebAnimationsCSS(); |
90 | 90 |
91 if (command_line.HasSwitch(switches::kEnableWebAnimationsSVG)) | 91 if (command_line.HasSwitch(switches::kEnableWebAnimationsSVG)) |
92 WebRuntimeFeatures::enableWebAnimationsSVG(); | 92 WebRuntimeFeatures::enableWebAnimationsSVG(); |
93 | 93 |
94 if (command_line.HasSwitch(switches::kEnableWebMIDI)) | 94 if (command_line.HasSwitch(switches::kEnableWebMIDI)) |
95 WebRuntimeFeatures::enableWebMIDI(true); | 95 WebRuntimeFeatures::enableWebMIDI(true); |
96 | 96 |
| 97 #if defined(OS_ANDROID) |
| 98 // Enable Device Motion on Android by default. |
| 99 WebRuntimeFeatures::enableDeviceMotion( |
| 100 !command_line.HasSwitch(switches::kDisableDeviceMotion)); |
| 101 #else |
97 if (command_line.HasSwitch(switches::kEnableDeviceMotion)) | 102 if (command_line.HasSwitch(switches::kEnableDeviceMotion)) |
98 WebRuntimeFeatures::enableDeviceMotion(true); | 103 WebRuntimeFeatures::enableDeviceMotion(true); |
| 104 #endif |
99 | 105 |
100 if (command_line.HasSwitch(switches::kDisableDeviceOrientation)) | 106 if (command_line.HasSwitch(switches::kDisableDeviceOrientation)) |
101 WebRuntimeFeatures::enableDeviceOrientation(false); | 107 WebRuntimeFeatures::enableDeviceOrientation(false); |
102 | 108 |
103 if (command_line.HasSwitch(switches::kDisableSpeechInput)) | 109 if (command_line.HasSwitch(switches::kDisableSpeechInput)) |
104 WebRuntimeFeatures::enableSpeechInput(false); | 110 WebRuntimeFeatures::enableSpeechInput(false); |
105 | 111 |
106 if (command_line.HasSwitch(switches::kDisableFileSystem)) | 112 if (command_line.HasSwitch(switches::kDisableFileSystem)) |
107 WebRuntimeFeatures::enableFileSystem(false); | 113 WebRuntimeFeatures::enableFileSystem(false); |
108 | 114 |
109 if (command_line.HasSwitch(switches::kEnableExperimentalCanvasFeatures)) | 115 if (command_line.HasSwitch(switches::kEnableExperimentalCanvasFeatures)) |
110 WebRuntimeFeatures::enableExperimentalCanvasFeatures(true); | 116 WebRuntimeFeatures::enableExperimentalCanvasFeatures(true); |
111 | 117 |
112 if (command_line.HasSwitch(switches::kEnableSpeechSynthesis)) | 118 if (command_line.HasSwitch(switches::kEnableSpeechSynthesis)) |
113 WebRuntimeFeatures::enableSpeechSynthesis(true); | 119 WebRuntimeFeatures::enableSpeechSynthesis(true); |
114 | 120 |
115 if (command_line.HasSwitch(switches::kEnableWebGLDraftExtensions)) | 121 if (command_line.HasSwitch(switches::kEnableWebGLDraftExtensions)) |
116 WebRuntimeFeatures::enableWebGLDraftExtensions(true); | 122 WebRuntimeFeatures::enableWebGLDraftExtensions(true); |
117 } | 123 } |
118 | 124 |
119 } // namespace content | 125 } // namespace content |
OLD | NEW |