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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 145283003: Switch AccessibilityMode to be a bitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src@enable
Patch Set: Tweak AccessibilityModeHelperTest 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/auto_reset.h" 11 #include "base/auto_reset.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/containers/hash_tables.h" 14 #include "base/containers/hash_tables.h"
15 #include "base/debug/trace_event.h" 15 #include "base/debug/trace_event.h"
16 #include "base/i18n/rtl.h" 16 #include "base/i18n/rtl.h"
17 #include "base/lazy_instance.h" 17 #include "base/lazy_instance.h"
18 #include "base/message_loop/message_loop.h" 18 #include "base/message_loop/message_loop.h"
19 #include "base/metrics/field_trial.h" 19 #include "base/metrics/field_trial.h"
20 #include "base/metrics/histogram.h" 20 #include "base/metrics/histogram.h"
21 #include "base/strings/string_number_conversions.h" 21 #include "base/strings/string_number_conversions.h"
22 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
23 #include "base/thread_task_runner_handle.h" 23 #include "base/thread_task_runner_handle.h"
24 #include "cc/output/compositor_frame.h" 24 #include "cc/output/compositor_frame.h"
25 #include "cc/output/compositor_frame_ack.h" 25 #include "cc/output/compositor_frame_ack.h"
26 #include "content/browser/accessibility/accessibility_mode_helper.h"
26 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 27 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
27 #include "content/browser/gpu/compositor_util.h" 28 #include "content/browser/gpu/compositor_util.h"
28 #include "content/browser/gpu/gpu_process_host.h" 29 #include "content/browser/gpu/gpu_process_host.h"
29 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 30 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
30 #include "content/browser/gpu/gpu_surface_tracker.h" 31 #include "content/browser/gpu/gpu_surface_tracker.h"
31 #include "content/browser/renderer_host/backing_store.h" 32 #include "content/browser/renderer_host/backing_store.h"
32 #include "content/browser/renderer_host/backing_store_manager.h" 33 #include "content/browser/renderer_host/backing_store_manager.h"
33 #include "content/browser/renderer_host/dip_util.h" 34 #include "content/browser/renderer_host/dip_util.h"
34 #include "content/browser/renderer_host/input/input_router_impl.h" 35 #include "content/browser/renderer_host/input/input_router_impl.h"
35 #include "content/browser/renderer_host/input/synthetic_gesture.h" 36 #include "content/browser/renderer_host/input/synthetic_gesture.h"
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 base::TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); 929 base::TimeDelta::FromMilliseconds(hung_renderer_delay_ms_));
929 } 930 }
930 931
931 void RenderWidgetHostImpl::StopHangMonitorTimeout() { 932 void RenderWidgetHostImpl::StopHangMonitorTimeout() {
932 if (hang_monitor_timeout_) 933 if (hang_monitor_timeout_)
933 hang_monitor_timeout_->Stop(); 934 hang_monitor_timeout_->Stop();
934 RendererIsResponsive(); 935 RendererIsResponsive();
935 } 936 }
936 937
937 void RenderWidgetHostImpl::EnableFullAccessibilityMode() { 938 void RenderWidgetHostImpl::EnableFullAccessibilityMode() {
938 SetAccessibilityMode(AccessibilityModeComplete); 939 AddAccessibilityMode(AccessibilityModeComplete);
939 } 940 }
940 941
941 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { 942 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) {
942 ForwardMouseEventWithLatencyInfo(mouse_event, ui::LatencyInfo()); 943 ForwardMouseEventWithLatencyInfo(mouse_event, ui::LatencyInfo());
943 } 944 }
944 945
945 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( 946 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo(
946 const blink::WebMouseEvent& mouse_event, 947 const blink::WebMouseEvent& mouse_event,
947 const ui::LatencyInfo& ui_latency) { 948 const ui::LatencyInfo& ui_latency) {
948 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", 949 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent",
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 2139
2139 void RenderWidgetHostImpl::SetBackground(const SkBitmap& background) { 2140 void RenderWidgetHostImpl::SetBackground(const SkBitmap& background) {
2140 Send(new ViewMsg_SetBackground(GetRoutingID(), background)); 2141 Send(new ViewMsg_SetBackground(GetRoutingID(), background));
2141 } 2142 }
2142 2143
2143 void RenderWidgetHostImpl::SetEditCommandsForNextKeyEvent( 2144 void RenderWidgetHostImpl::SetEditCommandsForNextKeyEvent(
2144 const std::vector<EditCommand>& commands) { 2145 const std::vector<EditCommand>& commands) {
2145 Send(new InputMsg_SetEditCommandsForNextKeyEvent(GetRoutingID(), commands)); 2146 Send(new InputMsg_SetEditCommandsForNextKeyEvent(GetRoutingID(), commands));
2146 } 2147 }
2147 2148
2148 void RenderWidgetHostImpl::SetAccessibilityMode(AccessibilityMode mode) { 2149 void RenderWidgetHostImpl::AddAccessibilityMode(AccessibilityMode mode) {
2150 SetAccessibilityMode(
2151 content::AddAccessibilityMode(accessibility_mode_, mode));
2152 }
2153
2154 void RenderWidgetHostImpl::RemoveAccessibilityMode(AccessibilityMode mode) {
2155 SetAccessibilityMode(
2156 content::RemoveAccessibilityMode(accessibility_mode_, mode));
2157 }
2158
2159 void RenderWidgetHostImpl::SetAccessibilityMode(unsigned int mode) {
2149 accessibility_mode_ = mode; 2160 accessibility_mode_ = mode;
2150 Send(new ViewMsg_SetAccessibilityMode(GetRoutingID(), mode)); 2161 Send(new ViewMsg_SetAccessibilityMode(GetRoutingID(), mode));
2151 } 2162 }
2152 2163
2153 void RenderWidgetHostImpl::AccessibilityDoDefaultAction(int object_id) { 2164 void RenderWidgetHostImpl::AccessibilityDoDefaultAction(int object_id) {
2154 Send(new AccessibilityMsg_DoDefaultAction(GetRoutingID(), object_id)); 2165 Send(new AccessibilityMsg_DoDefaultAction(GetRoutingID(), object_id));
2155 } 2166 }
2156 2167
2157 void RenderWidgetHostImpl::AccessibilitySetFocus(int object_id) { 2168 void RenderWidgetHostImpl::AccessibilitySetFocus(int object_id) {
2158 Send(new AccessibilityMsg_SetFocus(GetRoutingID(), object_id)); 2169 Send(new AccessibilityMsg_SetFocus(GetRoutingID(), object_id));
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
2569 } 2580 }
2570 } 2581 }
2571 2582
2572 // Add newly generated components into the latency info 2583 // Add newly generated components into the latency info
2573 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { 2584 for (lc = new_components.begin(); lc != new_components.end(); ++lc) {
2574 latency_info->latency_components[lc->first] = lc->second; 2585 latency_info->latency_components[lc->first] = lc->second;
2575 } 2586 }
2576 } 2587 }
2577 2588
2578 } // namespace content 2589 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698