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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 145283003: Switch AccessibilityMode to be a bitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src@enable
Patch Set: Switch back to AccessibilityMode enums in accessibility_ui.cc Created 6 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 RenderWidgetHostImpl* host_impl = RenderWidgetHostImpl::From( 1763 RenderWidgetHostImpl* host_impl = RenderWidgetHostImpl::From(
1764 host_view->GetRenderWidgetHost()); 1764 host_view->GetRenderWidgetHost());
1765 BrowserAccessibilityState* accessibility_state = 1765 BrowserAccessibilityState* accessibility_state =
1766 BrowserAccessibilityState::GetInstance(); 1766 BrowserAccessibilityState::GetInstance();
1767 if (enabled) { 1767 if (enabled) {
1768 // This enables accessibility globally unless it was explicitly disallowed 1768 // This enables accessibility globally unless it was explicitly disallowed
1769 // by a command-line flag. 1769 // by a command-line flag.
1770 accessibility_state->OnScreenReaderDetected(); 1770 accessibility_state->OnScreenReaderDetected();
1771 // If it was actually enabled globally, enable it for this RenderWidget now. 1771 // If it was actually enabled globally, enable it for this RenderWidget now.
1772 if (accessibility_state->IsAccessibleBrowser() && host_impl) 1772 if (accessibility_state->IsAccessibleBrowser() && host_impl)
1773 host_impl->SetAccessibilityMode(AccessibilityModeComplete); 1773 host_impl->AddAccessibilityMode(AccessibilityModeComplete);
1774 } else { 1774 } else {
1775 accessibility_state->DisableAccessibility(); 1775 accessibility_state->ResetAccessibilityMode();
1776 if (host_impl) 1776 if (host_impl)
1777 host_impl->SetAccessibilityMode(AccessibilityModeOff); 1777 host_impl->ResetAccessibilityMode();
1778 } 1778 }
1779 } 1779 }
1780 1780
1781 void ContentViewCoreImpl::SendSingleTapUma(JNIEnv* env, 1781 void ContentViewCoreImpl::SendSingleTapUma(JNIEnv* env,
1782 jobject obj, 1782 jobject obj,
1783 jint type, 1783 jint type,
1784 jint count) { 1784 jint count) {
1785 UMA_HISTOGRAM_ENUMERATION("Event.SingleTapType", type, count); 1785 UMA_HISTOGRAM_ENUMERATION("Event.SingleTapType", type, count);
1786 } 1786 }
1787 1787
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1860 reinterpret_cast<ui::ViewAndroid*>(view_android), 1860 reinterpret_cast<ui::ViewAndroid*>(view_android),
1861 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1861 reinterpret_cast<ui::WindowAndroid*>(window_android));
1862 return reinterpret_cast<intptr_t>(view); 1862 return reinterpret_cast<intptr_t>(view);
1863 } 1863 }
1864 1864
1865 bool RegisterContentViewCore(JNIEnv* env) { 1865 bool RegisterContentViewCore(JNIEnv* env) {
1866 return RegisterNativesImpl(env); 1866 return RegisterNativesImpl(env);
1867 } 1867 }
1868 1868
1869 } // namespace content 1869 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698