| 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 25 matching lines...) Expand all  Loading... | 
| 36   // Android does not support the Gamepad API. | 36   // Android does not support the Gamepad API. | 
| 37   WebRuntimeFeatures::enableGamepad(false); | 37   WebRuntimeFeatures::enableGamepad(false); | 
| 38   // Android does not have support for PagePopup | 38   // Android does not have support for PagePopup | 
| 39   WebRuntimeFeatures::enablePagePopup(false); | 39   WebRuntimeFeatures::enablePagePopup(false); | 
| 40   // datalist on Android is not enabled | 40   // datalist on Android is not enabled | 
| 41   WebRuntimeFeatures::enableDataListElement(false); | 41   WebRuntimeFeatures::enableDataListElement(false); | 
| 42   // Android does not yet support the Web Notification API. crbug.com/115320 | 42   // Android does not yet support the Web Notification API. crbug.com/115320 | 
| 43   WebRuntimeFeatures::enableNotifications(false); | 43   WebRuntimeFeatures::enableNotifications(false); | 
| 44   // Android does not yet support SharedWorker. crbug.com/154571 | 44   // Android does not yet support SharedWorker. crbug.com/154571 | 
| 45   WebRuntimeFeatures::enableSharedWorker(false); | 45   WebRuntimeFeatures::enableSharedWorker(false); | 
|  | 46   // Android does not yet support NavigatorContentUtils. | 
|  | 47   WebRuntimeFeatures::enableNavigatorContentUtils(false); | 
| 46 #endif  // defined(OS_ANDROID) | 48 #endif  // defined(OS_ANDROID) | 
| 47 } | 49 } | 
| 48 | 50 | 
| 49 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( | 51 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( | 
| 50     const CommandLine& command_line) { | 52     const CommandLine& command_line) { | 
| 51   WebRuntimeFeatures::enableStableFeatures(true); | 53   WebRuntimeFeatures::enableStableFeatures(true); | 
| 52 | 54 | 
| 53   if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) | 55   if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) | 
| 54     WebRuntimeFeatures::enableExperimentalFeatures(true); | 56     WebRuntimeFeatures::enableExperimentalFeatures(true); | 
| 55 | 57 | 
| 56   SetRuntimeFeatureDefaultsForPlatform(); | 58   SetRuntimeFeatureDefaultsForPlatform(); | 
| 57 | 59 | 
| 58   if (command_line.HasSwitch(switches::kDisableDatabases)) | 60   if (command_line.HasSwitch(switches::kDisableDatabases)) | 
| 59     WebRuntimeFeatures::enableDatabase(false); | 61     WebRuntimeFeatures::enableDatabase(false); | 
| 60 | 62 | 
| 61   if (command_line.HasSwitch(switches::kDisableApplicationCache)) | 63   if (command_line.HasSwitch(switches::kDisableApplicationCache)) | 
| 62     WebRuntimeFeatures::enableApplicationCache(false); | 64     WebRuntimeFeatures::enableApplicationCache(false); | 
| 63 | 65 | 
| 64   if (command_line.HasSwitch(switches::kDisableDesktopNotifications)) | 66   if (command_line.HasSwitch(switches::kDisableDesktopNotifications)) | 
| 65     WebRuntimeFeatures::enableNotifications(false); | 67     WebRuntimeFeatures::enableNotifications(false); | 
| 66 | 68 | 
|  | 69   if (command_line.HasSwitch(switches::kDisableNavigatorContentUtils)) | 
|  | 70     WebRuntimeFeatures::enableNavigatorContentUtils(false); | 
|  | 71 | 
| 67   if (command_line.HasSwitch(switches::kDisableLocalStorage)) | 72   if (command_line.HasSwitch(switches::kDisableLocalStorage)) | 
| 68     WebRuntimeFeatures::enableLocalStorage(false); | 73     WebRuntimeFeatures::enableLocalStorage(false); | 
| 69 | 74 | 
| 70   if (command_line.HasSwitch(switches::kDisableSessionStorage)) | 75   if (command_line.HasSwitch(switches::kDisableSessionStorage)) | 
| 71     WebRuntimeFeatures::enableSessionStorage(false); | 76     WebRuntimeFeatures::enableSessionStorage(false); | 
| 72 | 77 | 
| 73   if (command_line.HasSwitch(switches::kDisableGeolocation)) | 78   if (command_line.HasSwitch(switches::kDisableGeolocation)) | 
| 74     WebRuntimeFeatures::enableGeolocation(false); | 79     WebRuntimeFeatures::enableGeolocation(false); | 
| 75 | 80 | 
| 76   if (command_line.HasSwitch(switches::kDisableWebKitMediaSource)) | 81   if (command_line.HasSwitch(switches::kDisableWebKitMediaSource)) | 
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 154     WebRuntimeFeatures::enableInputModeAttribute(true); | 159     WebRuntimeFeatures::enableInputModeAttribute(true); | 
| 155 | 160 | 
| 156   if (command_line.HasSwitch(switches::kEnableFastTextAutosizing)) | 161   if (command_line.HasSwitch(switches::kEnableFastTextAutosizing)) | 
| 157     WebRuntimeFeatures::enableFastTextAutosizing(true); | 162     WebRuntimeFeatures::enableFastTextAutosizing(true); | 
| 158 | 163 | 
| 159   if (command_line.HasSwitch(switches::kEnableRepaintAfterLayout)) | 164   if (command_line.HasSwitch(switches::kEnableRepaintAfterLayout)) | 
| 160     WebRuntimeFeatures::enableRepaintAfterLayout(true); | 165     WebRuntimeFeatures::enableRepaintAfterLayout(true); | 
| 161 } | 166 } | 
| 162 | 167 | 
| 163 }  // namespace content | 168 }  // namespace content | 
| OLD | NEW | 
|---|