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

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

Issue 273423004: Migrate accessibility from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get rid of ForEachFrameAndPendingFrame Created 6 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 | Annotate | Revision Log
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"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/json/json_writer.h" 12 #include "base/json/json_writer.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "cc/layers/layer.h" 17 #include "cc/layers/layer.h"
18 #include "cc/layers/solid_color_layer.h" 18 #include "cc/layers/solid_color_layer.h"
19 #include "cc/output/begin_frame_args.h" 19 #include "cc/output/begin_frame_args.h"
20 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
20 #include "content/browser/android/gesture_event_type.h" 21 #include "content/browser/android/gesture_event_type.h"
21 #include "content/browser/android/interstitial_page_delegate_android.h" 22 #include "content/browser/android/interstitial_page_delegate_android.h"
22 #include "content/browser/android/load_url_params.h" 23 #include "content/browser/android/load_url_params.h"
23 #include "content/browser/frame_host/interstitial_page_impl.h" 24 #include "content/browser/frame_host/interstitial_page_impl.h"
24 #include "content/browser/frame_host/navigation_controller_impl.h" 25 #include "content/browser/frame_host/navigation_controller_impl.h"
25 #include "content/browser/frame_host/navigation_entry_impl.h" 26 #include "content/browser/frame_host/navigation_entry_impl.h"
26 #include "content/browser/geolocation/geolocation_dispatcher_host.h" 27 #include "content/browser/geolocation/geolocation_dispatcher_host.h"
27 #include "content/browser/media/android/media_web_contents_observer.h" 28 #include "content/browser/media/android/media_web_contents_observer.h"
28 #include "content/browser/renderer_host/compositor_impl_android.h" 29 #include "content/browser/renderer_host/compositor_impl_android.h"
29 #include "content/browser/renderer_host/input/motion_event_android.h" 30 #include "content/browser/renderer_host/input/motion_event_android.h"
30 #include "content/browser/renderer_host/input/web_input_event_builders_android.h " 31 #include "content/browser/renderer_host/input/web_input_event_builders_android.h "
31 #include "content/browser/renderer_host/input/web_input_event_util.h" 32 #include "content/browser/renderer_host/input/web_input_event_util.h"
32 #include "content/browser/renderer_host/java/java_bound_object.h" 33 #include "content/browser/renderer_host/java/java_bound_object.h"
33 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager .h" 34 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager .h"
34 #include "content/browser/renderer_host/render_view_host_impl.h" 35 #include "content/browser/renderer_host/render_view_host_impl.h"
35 #include "content/browser/renderer_host/render_widget_host_impl.h" 36 #include "content/browser/renderer_host/render_widget_host_impl.h"
36 #include "content/browser/renderer_host/render_widget_host_view_android.h" 37 #include "content/browser/renderer_host/render_widget_host_view_android.h"
37 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host. h" 38 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host. h"
38 #include "content/browser/ssl/ssl_host_state.h" 39 #include "content/browser/ssl/ssl_host_state.h"
39 #include "content/browser/web_contents/web_contents_view_android.h" 40 #include "content/browser/web_contents/web_contents_view_android.h"
40 #include "content/common/input/web_input_event_traits.h" 41 #include "content/common/input/web_input_event_traits.h"
41 #include "content/common/input_messages.h" 42 #include "content/common/input_messages.h"
42 #include "content/common/view_messages.h" 43 #include "content/common/view_messages.h"
43 #include "content/public/browser/browser_accessibility_state.h"
44 #include "content/public/browser/browser_context.h" 44 #include "content/public/browser/browser_context.h"
45 #include "content/public/browser/favicon_status.h" 45 #include "content/public/browser/favicon_status.h"
46 #include "content/public/browser/render_frame_host.h" 46 #include "content/public/browser/render_frame_host.h"
47 #include "content/public/browser/web_contents.h" 47 #include "content/public/browser/web_contents.h"
48 #include "content/public/common/content_client.h" 48 #include "content/public/common/content_client.h"
49 #include "content/public/common/content_switches.h" 49 #include "content/public/common/content_switches.h"
50 #include "content/public/common/menu_item.h" 50 #include "content/public/common/menu_item.h"
51 #include "content/public/common/page_transition_types.h" 51 #include "content/public/common/page_transition_types.h"
52 #include "content/public/common/user_agent.h" 52 #include "content/public/common/user_agent.h"
53 #include "jni/ContentViewCore_jni.h" 53 #include "jni/ContentViewCore_jni.h"
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 } 1496 }
1497 } 1497 }
1498 1498
1499 void ContentViewCoreImpl::SetAccessibilityEnabled(JNIEnv* env, jobject obj, 1499 void ContentViewCoreImpl::SetAccessibilityEnabled(JNIEnv* env, jobject obj,
1500 bool enabled) { 1500 bool enabled) {
1501 SetAccessibilityEnabledInternal(enabled); 1501 SetAccessibilityEnabledInternal(enabled);
1502 } 1502 }
1503 1503
1504 void ContentViewCoreImpl::SetAccessibilityEnabledInternal(bool enabled) { 1504 void ContentViewCoreImpl::SetAccessibilityEnabledInternal(bool enabled) {
1505 accessibility_enabled_ = enabled; 1505 accessibility_enabled_ = enabled;
1506 RenderWidgetHostViewAndroid* host_view = GetRenderWidgetHostViewAndroid(); 1506 BrowserAccessibilityStateImpl* accessibility_state =
1507 if (!host_view) 1507 BrowserAccessibilityStateImpl::GetInstance();
1508 return;
1509 RenderWidgetHostImpl* host_impl = RenderWidgetHostImpl::From(
1510 host_view->GetRenderWidgetHost());
1511 BrowserAccessibilityState* accessibility_state =
1512 BrowserAccessibilityState::GetInstance();
1513 if (enabled) { 1508 if (enabled) {
1514 // This enables accessibility globally unless it was explicitly disallowed 1509 // This enables accessibility globally unless it was explicitly disallowed
1515 // by a command-line flag. 1510 // by a command-line flag.
1516 accessibility_state->OnScreenReaderDetected(); 1511 accessibility_state->OnScreenReaderDetected();
1517 // If it was actually enabled globally, enable it for this RenderWidget now. 1512 // If it was actually enabled globally, enable it for this RenderWidget now.
1518 if (accessibility_state->IsAccessibleBrowser() && host_impl) 1513 if (accessibility_state->IsAccessibleBrowser() && web_contents_)
1519 host_impl->AddAccessibilityMode(AccessibilityModeComplete); 1514 web_contents_->AddAccessibilityMode(AccessibilityModeComplete);
1520 } else { 1515 } else {
1521 accessibility_state->ResetAccessibilityMode(); 1516 accessibility_state->ResetAccessibilityMode();
1522 if (host_impl) 1517 if (web_contents_) {
1523 host_impl->ResetAccessibilityMode(); 1518 web_contents_->SetAccessibilityMode(
1519 accessibility_state->accessibility_mode());
1520 }
1524 } 1521 }
1525 } 1522 }
1526 1523
1527 void ContentViewCoreImpl::SendOrientationChangeEventInternal() { 1524 void ContentViewCoreImpl::SendOrientationChangeEventInternal() {
1528 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); 1525 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid();
1529 if (rwhv) 1526 if (rwhv)
1530 rwhv->UpdateScreenInfo(GetViewAndroid()); 1527 rwhv->UpdateScreenInfo(GetViewAndroid());
1531 1528
1532 // TODO(mlamouri): temporary plumbing for Screen Orientation, this will change 1529 // TODO(mlamouri): temporary plumbing for Screen Orientation, this will change
1533 // in the future. The OnResize IPC message sent from UpdateScreenInfo() will 1530 // in the future. The OnResize IPC message sent from UpdateScreenInfo() will
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 reinterpret_cast<ui::WindowAndroid*>(window_android), 1613 reinterpret_cast<ui::WindowAndroid*>(window_android),
1617 retained_objects_set); 1614 retained_objects_set);
1618 return reinterpret_cast<intptr_t>(view); 1615 return reinterpret_cast<intptr_t>(view);
1619 } 1616 }
1620 1617
1621 bool RegisterContentViewCore(JNIEnv* env) { 1618 bool RegisterContentViewCore(JNIEnv* env) {
1622 return RegisterNativesImpl(env); 1619 return RegisterNativesImpl(env);
1623 } 1620 }
1624 1621
1625 } // namespace content 1622 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698