Chromium Code Reviews| Index: content/renderer/render_view_impl.cc |
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
| index 49ba175ec55a9161237d97b9908bd1b05ef156e9..80366a49832d53317baa1006034a842cf5af7702 100644 |
| --- a/content/renderer/render_view_impl.cc |
| +++ b/content/renderer/render_view_impl.cc |
| @@ -840,7 +840,7 @@ RenderViewImpl::RenderViewImpl(RenderViewImplParams* params) |
| web_user_media_client_(NULL), |
| midi_dispatcher_(NULL), |
| devtools_agent_(NULL), |
| - accessibility_mode_(AccessibilityModeOff), |
| + accessibility_mode_(0), |
|
David Tseng
2014/01/27 22:16:06
Define/use the enum here.
aboxhall
2014/01/28 17:48:26
Done.
|
| renderer_accessibility_(NULL), |
| mouse_lock_dispatcher_(NULL), |
| #if defined(OS_ANDROID) |
| @@ -1093,7 +1093,7 @@ RenderViewImpl* RenderViewImpl::Create( |
| bool hidden, |
| int32 next_page_id, |
| const blink::WebScreenInfo& screen_info, |
| - AccessibilityMode accessibility_mode, |
| + unsigned int accessibility_mode, |
| bool allow_partial_swap) { |
| DCHECK(routing_id != MSG_ROUTING_NONE); |
| RenderViewImplParams params( |
| @@ -5287,7 +5287,7 @@ void RenderViewImpl::OnSetBackground(const SkBitmap& background) { |
| SetBackground(background); |
| } |
| -void RenderViewImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { |
| +void RenderViewImpl::OnSetAccessibilityMode(unsigned int new_mode) { |
| if (accessibility_mode_ == new_mode) |
| return; |
| accessibility_mode_ = new_mode; |
| @@ -5295,10 +5295,13 @@ void RenderViewImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { |
| delete renderer_accessibility_; |
| renderer_accessibility_ = NULL; |
| } |
| - if (accessibility_mode_ == AccessibilityModeComplete) |
| + if (!(accessibility_mode_ & AccessibilityModeFlagRenderer)) |
|
David Tseng
2014/01/27 22:16:06
You might want to check this. What happens to !0b0
aboxhall
2014/01/28 17:48:26
In C++, "the value zero (for integral, floating-po
|
| + return; |
| + |
| + if (!(accessibility_mode_ & AccessibilityModeFlagEditableTextOnly)) |
| renderer_accessibility_ = new RendererAccessibilityComplete(this); |
| #if !defined(OS_ANDROID) |
| - else if (accessibility_mode_ == AccessibilityModeEditableTextOnly) |
| + else if (accessibility_mode_ & AccessibilityModeFlagEditableTextOnly) |
| renderer_accessibility_ = new RendererAccessibilityFocusOnly(this); |
| #endif |
| } |
| @@ -6111,7 +6114,9 @@ bool RenderViewImpl::didTapMultipleTargets( |
| const WebVector<WebRect>& target_rects) { |
| // Never show a disambiguation popup when accessibility is enabled, |
| // as this interferes with "touch exploration". |
| - if (accessibility_mode_ == AccessibilityModeComplete) |
| + if (accessibility_mode_ & AccessibilityModeFlagRenderer && |
|
David Tseng
2014/01/27 22:16:06
Please define and use accessibility complete in th
aboxhall
2014/01/28 17:48:26
Done. Note that we explicitly don't want to check
|
| + accessibility_mode_ & AccessibilityModeFlagPlatform && |
| + !(accessibility_mode_ & AccessibilityModeFlagEditableTextOnly)) |
| return false; |
| gfx::Rect finger_rect( |