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

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: Address dtseng's comments Created 6 years, 11 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
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 base::TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); 912 base::TimeDelta::FromMilliseconds(hung_renderer_delay_ms_));
913 } 913 }
914 914
915 void RenderWidgetHostImpl::StopHangMonitorTimeout() { 915 void RenderWidgetHostImpl::StopHangMonitorTimeout() {
916 if (hang_monitor_timeout_) 916 if (hang_monitor_timeout_)
917 hang_monitor_timeout_->Stop(); 917 hang_monitor_timeout_->Stop();
918 RendererIsResponsive(); 918 RendererIsResponsive();
919 } 919 }
920 920
921 void RenderWidgetHostImpl::EnableFullAccessibilityMode() { 921 void RenderWidgetHostImpl::EnableFullAccessibilityMode() {
922 SetAccessibilityMode(AccessibilityModeComplete); 922 SetAccessibilityMode(accessibility_mode_ | AccessibilityModeComplete);
923 } 923 }
924 924
925 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { 925 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) {
926 ForwardMouseEventWithLatencyInfo(MouseEventWithLatencyInfo( 926 ForwardMouseEventWithLatencyInfo(MouseEventWithLatencyInfo(
927 mouse_event, CreateRWHLatencyInfoIfNotExist(NULL, mouse_event.type))); 927 mouse_event, CreateRWHLatencyInfoIfNotExist(NULL, mouse_event.type)));
928 } 928 }
929 929
930 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( 930 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo(
931 const MouseEventWithLatencyInfo& mouse_event) { 931 const MouseEventWithLatencyInfo& mouse_event) {
932 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", 932 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent",
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2091 2091
2092 void RenderWidgetHostImpl::SetBackground(const SkBitmap& background) { 2092 void RenderWidgetHostImpl::SetBackground(const SkBitmap& background) {
2093 Send(new ViewMsg_SetBackground(GetRoutingID(), background)); 2093 Send(new ViewMsg_SetBackground(GetRoutingID(), background));
2094 } 2094 }
2095 2095
2096 void RenderWidgetHostImpl::SetEditCommandsForNextKeyEvent( 2096 void RenderWidgetHostImpl::SetEditCommandsForNextKeyEvent(
2097 const std::vector<EditCommand>& commands) { 2097 const std::vector<EditCommand>& commands) {
2098 Send(new InputMsg_SetEditCommandsForNextKeyEvent(GetRoutingID(), commands)); 2098 Send(new InputMsg_SetEditCommandsForNextKeyEvent(GetRoutingID(), commands));
2099 } 2099 }
2100 2100
2101 void RenderWidgetHostImpl::SetAccessibilityMode(AccessibilityMode mode) { 2101 void RenderWidgetHostImpl::SetAccessibilityMode(unsigned int mode) {
2102 accessibility_mode_ = mode; 2102 accessibility_mode_ = mode;
2103 Send(new ViewMsg_SetAccessibilityMode(GetRoutingID(), mode)); 2103 Send(new ViewMsg_SetAccessibilityMode(GetRoutingID(), mode));
2104 } 2104 }
2105 2105
2106 void RenderWidgetHostImpl::SetRendererAccessibilityMode(bool on) {
2107 if (bool(accessibility_mode_ & AccessibilityModeFlagRenderer) == on)
David Tseng 2014/01/27 22:16:06 Ditto; cast; and xor.
aboxhall 2014/01/28 00:18:42 Done.
2108 return;
2109 if (on)
2110 accessibility_mode_ |= AccessibilityModeFlagRenderer;
2111 else
2112 accessibility_mode_ &= (~AccessibilityModeFlagRenderer);
2113 Send(new ViewMsg_SetAccessibilityMode(GetRoutingID(), accessibility_mode_));
2114 }
2115
2106 void RenderWidgetHostImpl::AccessibilityDoDefaultAction(int object_id) { 2116 void RenderWidgetHostImpl::AccessibilityDoDefaultAction(int object_id) {
2107 Send(new AccessibilityMsg_DoDefaultAction(GetRoutingID(), object_id)); 2117 Send(new AccessibilityMsg_DoDefaultAction(GetRoutingID(), object_id));
2108 } 2118 }
2109 2119
2110 void RenderWidgetHostImpl::AccessibilitySetFocus(int object_id) { 2120 void RenderWidgetHostImpl::AccessibilitySetFocus(int object_id) {
2111 Send(new AccessibilityMsg_SetFocus(GetRoutingID(), object_id)); 2121 Send(new AccessibilityMsg_SetFocus(GetRoutingID(), object_id));
2112 } 2122 }
2113 2123
2114 void RenderWidgetHostImpl::AccessibilityScrollToMakeVisible( 2124 void RenderWidgetHostImpl::AccessibilityScrollToMakeVisible(
2115 int acc_obj_id, gfx::Rect subfocus) { 2125 int acc_obj_id, gfx::Rect subfocus) {
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 continue; 2478 continue;
2469 } 2479 }
2470 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); 2480 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh);
2471 if (rwhi_set.insert(rwhi).second) 2481 if (rwhi_set.insert(rwhi).second)
2472 rwhi->FrameSwapped(latency_info); 2482 rwhi->FrameSwapped(latency_info);
2473 } 2483 }
2474 } 2484 }
2475 } 2485 }
2476 2486
2477 } // namespace content 2487 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698