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

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

Issue 15741009: Native Android accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix AwContents for ICS Created 7 years, 6 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 14 matching lines...) Expand all
25 #include "content/browser/renderer_host/render_view_host_impl.h" 25 #include "content/browser/renderer_host/render_view_host_impl.h"
26 #include "content/browser/renderer_host/render_widget_host_impl.h" 26 #include "content/browser/renderer_host/render_widget_host_impl.h"
27 #include "content/browser/renderer_host/render_widget_host_view_android.h" 27 #include "content/browser/renderer_host/render_widget_host_view_android.h"
28 #include "content/browser/ssl/ssl_host_state.h" 28 #include "content/browser/ssl/ssl_host_state.h"
29 #include "content/browser/web_contents/interstitial_page_impl.h" 29 #include "content/browser/web_contents/interstitial_page_impl.h"
30 #include "content/browser/web_contents/navigation_controller_impl.h" 30 #include "content/browser/web_contents/navigation_controller_impl.h"
31 #include "content/browser/web_contents/navigation_entry_impl.h" 31 #include "content/browser/web_contents/navigation_entry_impl.h"
32 #include "content/browser/web_contents/web_contents_view_android.h" 32 #include "content/browser/web_contents/web_contents_view_android.h"
33 #include "content/common/input_messages.h" 33 #include "content/common/input_messages.h"
34 #include "content/common/view_messages.h" 34 #include "content/common/view_messages.h"
35 #include "content/public/browser/browser_accessibility_state.h"
35 #include "content/public/browser/browser_context.h" 36 #include "content/public/browser/browser_context.h"
36 #include "content/public/browser/favicon_status.h" 37 #include "content/public/browser/favicon_status.h"
37 #include "content/public/browser/notification_details.h" 38 #include "content/public/browser/notification_details.h"
38 #include "content/public/browser/notification_service.h" 39 #include "content/public/browser/notification_service.h"
39 #include "content/public/browser/notification_source.h" 40 #include "content/public/browser/notification_source.h"
40 #include "content/public/browser/notification_types.h" 41 #include "content/public/browser/notification_types.h"
41 #include "content/public/browser/web_contents.h" 42 #include "content/public/browser/web_contents.h"
42 #include "content/public/common/content_client.h" 43 #include "content/public/common/content_client.h"
43 #include "content/public/common/content_switches.h" 44 #include "content/public/common/content_switches.h"
44 #include "content/public/common/page_transition_types.h" 45 #include "content/public/common/page_transition_types.h"
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1565 // Send the override to the renderer. 1566 // Send the override to the renderer.
1566 if (reload_on_state_change) { 1567 if (reload_on_state_change) {
1567 // Reloading the page will send the override down as part of the 1568 // Reloading the page will send the override down as part of the
1568 // navigation IPC message. 1569 // navigation IPC message.
1569 NavigationControllerImpl& controller = 1570 NavigationControllerImpl& controller =
1570 static_cast<NavigationControllerImpl&>(web_contents_->GetController()); 1571 static_cast<NavigationControllerImpl&>(web_contents_->GetController());
1571 controller.ReloadOriginalRequestURL(false); 1572 controller.ReloadOriginalRequestURL(false);
1572 } 1573 }
1573 } 1574 }
1574 1575
1576 void ContentViewCoreImpl::SetAccessibilityEnabled(JNIEnv* env, jobject obj,
1577 bool enabled) {
1578 RenderWidgetHostImpl* host_impl = RenderWidgetHostImpl::From(
1579 GetRenderWidgetHostViewAndroid()->GetRenderWidgetHost());
1580 if (enabled) {
1581 BrowserAccessibilityState::GetInstance()->EnableAccessibility();
1582 host_impl->SetAccessibilityMode(AccessibilityModeComplete);
1583 } else {
1584 BrowserAccessibilityState::GetInstance()->DisableAccessibility();
1585 host_impl->SetAccessibilityMode(AccessibilityModeOff);
1586 }
1587 }
1588
1575 // This is called for each ContentView. 1589 // This is called for each ContentView.
1576 jint Init(JNIEnv* env, jobject obj, 1590 jint Init(JNIEnv* env, jobject obj,
1577 jboolean hardware_accelerated, 1591 jboolean hardware_accelerated,
1578 jint native_web_contents, 1592 jint native_web_contents,
1579 jint view_android, 1593 jint view_android,
1580 jint window_android) { 1594 jint window_android) {
1581 ContentViewCoreImpl* view = new ContentViewCoreImpl( 1595 ContentViewCoreImpl* view = new ContentViewCoreImpl(
1582 env, obj, hardware_accelerated, 1596 env, obj, hardware_accelerated,
1583 reinterpret_cast<WebContents*>(native_web_contents), 1597 reinterpret_cast<WebContents*>(native_web_contents),
1584 reinterpret_cast<ui::ViewAndroid*>(view_android), 1598 reinterpret_cast<ui::ViewAndroid*>(view_android),
1585 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1599 reinterpret_cast<ui::WindowAndroid*>(window_android));
1586 return reinterpret_cast<jint>(view); 1600 return reinterpret_cast<jint>(view);
1587 } 1601 }
1588 1602
1589 bool RegisterContentViewCore(JNIEnv* env) { 1603 bool RegisterContentViewCore(JNIEnv* env) {
1590 return RegisterNativesImpl(env); 1604 return RegisterNativesImpl(env);
1591 } 1605 }
1592 1606
1593 } // namespace content 1607 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698