summaryrefslogtreecommitdiffstats
path: root/chrome/browser/android
diff options
context:
space:
mode:
authordtrainor@chromium.org <dtrainor@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 05:38:39 +0000
committerdtrainor@chromium.org <dtrainor@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 05:38:39 +0000
commit8b327ef9bfeb20ddc7036c7fd3c0d7c3b745aa90 (patch)
tree2a4439e0eab371d1769aee72576d94049d487f0d /chrome/browser/android
parenta659d4f0e945cfee5da3d3a3402c0d273679db15 (diff)
downloadchromium_src-8b327ef9bfeb20ddc7036c7fd3c0d7c3b745aa90.zip
chromium_src-8b327ef9bfeb20ddc7036c7fd3c0d7c3b745aa90.tar.gz
chromium_src-8b327ef9bfeb20ddc7036c7fd3c0d7c3b745aa90.tar.bz2
Append talkback parameter to product tour
- When Accessibility is enabled append a parameter to the product tour. BUG=346736 Review URL: https://codereview.chromium.org/196363002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258198 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/android')
-rw-r--r--chrome/browser/android/accessibility_util.cc25
-rw-r--r--chrome/browser/android/accessibility_util.h26
-rw-r--r--chrome/browser/android/chrome_jni_registrar.cc2
3 files changed, 53 insertions, 0 deletions
diff --git a/chrome/browser/android/accessibility_util.cc b/chrome/browser/android/accessibility_util.cc
new file mode 100644
index 0000000..1adb093
--- /dev/null
+++ b/chrome/browser/android/accessibility_util.cc
@@ -0,0 +1,25 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/android/jni_android.h"
+#include "chrome/browser/android/accessibility_util.h"
+#include "jni/AccessibilityUtil_jni.h"
+
+namespace chrome {
+namespace android {
+
+bool AccessibilityUtil::Register(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+bool AccessibilityUtil::IsAccessibilityEnabled() {
+ return Java_AccessibilityUtil_isAccessibilityEnabled(
+ base::android::AttachCurrentThread(),
+ base::android::GetApplicationContext());
+}
+
+AccessibilityUtil::AccessibilityUtil() { }
+
+} // namespace android
+} // namespace chrome
diff --git a/chrome/browser/android/accessibility_util.h b/chrome/browser/android/accessibility_util.h
new file mode 100644
index 0000000..4b936bf
--- /dev/null
+++ b/chrome/browser/android/accessibility_util.h
@@ -0,0 +1,26 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_ANDROID_ACCESSIBILITY_UTIL_H_
+#define CHROME_BROWSER_ANDROID_ANDROID_ACCESSIBILITY_UTIL_H_
+
+#include "base/android/jni_android.h"
+
+namespace chrome {
+namespace android {
+
+class AccessibilityUtil {
+ public:
+ static bool Register(JNIEnv* env);
+
+ static bool IsAccessibilityEnabled();
+
+ private:
+ AccessibilityUtil();
+};
+
+} // namespace android
+} // namespace chrome
+
+#endif // CHROME_BROWSER_ANDROID_ANDROID_ACCESSIBILITY_UTIL_H_
diff --git a/chrome/browser/android/chrome_jni_registrar.cc b/chrome/browser/android/chrome_jni_registrar.cc
index 38f28b3..6d931b1 100644
--- a/chrome/browser/android/chrome_jni_registrar.cc
+++ b/chrome/browser/android/chrome_jni_registrar.cc
@@ -7,6 +7,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
#include "base/debug/trace_event.h"
+#include "chrome/browser/android/accessibility_util.h"
#include "chrome/browser/android/banners/app_banner_manager.h"
#include "chrome/browser/android/bookmarks/bookmarks_bridge.h"
#include "chrome/browser/android/chrome_web_contents_delegate_android.h"
@@ -85,6 +86,7 @@ static base::android::RegistrationMethod kChromeRegisteredMethods[] = {
web_contents_delegate_android::RegisterWebContentsDelegateAndroidJni },
{ "RegisterAuxiliaryProfileLoader", autofill::RegisterAutofillAndroidJni },
// Register JNI for chrome classes.
+ { "AccessibilityUtils", AccessibilityUtil::Register },
{ "AccountManagementScreenHelper", AccountManagementScreenHelper::Register },
{ "AndroidProfileOAuth2TokenService",
AndroidProfileOAuth2TokenService::Register },