Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Unified Diff: content/child/runtime_features.cc

Issue 133943002: Gamepad API support for chrome on android (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/child/runtime_features.cc
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index 916f08d31b0475263e3ff872342ae0b058438785..509353fa234b8ef390f5468941acfb58bd5e6685 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -4,6 +4,7 @@
#include "content/child/runtime_features.h"
+#include "base/android/build_info.h"
#include "base/command_line.h"
#include "content/common/content_switches_internal.h"
#include "content/public/common/content_switches.h"
@@ -33,8 +34,10 @@ static void SetRuntimeFeatureDefaultsForPlatform() {
media::MediaCodecBridge::IsAvailable() &&
((android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM) ||
(android_getCpuFamily() == ANDROID_CPU_FAMILY_X86)));
- // Android does not support the Gamepad API.
- WebRuntimeFeatures::enableGamepad(false);
+
+ // Android supports gamepad API for JellyBean and beyond
+ WebRuntimeFeatures::enableGamepad(
+ base::android::BuildInfo::GetInstance()->sdk_int() >= 16);
// Android does not have support for PagePopup
WebRuntimeFeatures::enablePagePopup(false);
// Android does not yet support the Web Notification API. crbug.com/115320
@@ -89,6 +92,7 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (!command_line.HasSwitch(switches::kEnableSpeechRecognition))
WebRuntimeFeatures::enableScriptedSpeech(false);
+
jdduke (slow) 2014/05/29 17:46:36 Nit: Remove this extra newline.
SaurabhK 2014/05/30 09:13:45 On 2014/05/29 17:46:36, jdduke wrote: Done.
#endif
if (command_line.HasSwitch(switches::kEnableServiceWorker))

Powered by Google App Engine
This is Rietveld 408576698