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

Unified Diff: content/renderer/accessibility/renderer_accessibility_focus_only.h

Issue 651593002: Remove RendererAccessibilityFocusOnly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert patch set #4 Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/accessibility/renderer_accessibility_focus_only.h
diff --git a/content/renderer/accessibility/renderer_accessibility_focus_only.h b/content/renderer/accessibility/renderer_accessibility_focus_only.h
deleted file mode 100644
index df42303273e16895bbb7477176fbb471d6a9c723..0000000000000000000000000000000000000000
--- a/content/renderer/accessibility/renderer_accessibility_focus_only.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_FOCUS_ONLY_H_
-#define CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_FOCUS_ONLY_H_
-
-#include "content/renderer/accessibility/renderer_accessibility.h"
-
-namespace content {
-
-// This is an accessibility implementation that only handles whatever
-// node has focus, ignoring everything else. It's here because on Windows 8,
-// we need to use accessibility APIs to tell the operating system when a
-// touch should pop up the on-screen keyboard, but it's not worth the
-// performance overhead to enable full accessibility support.
-//
-// Here's how the on-screen keyboard works in Windows 8 "Metro-style" apps:
-//
-// 1. The user touches a control.
-// 2. If the application determines focus moves to an editable text control,
-// it sends a native focus event, pointing to a native accessibility object
-// with information about the control that was just focused.
-// 3. If the operating system sees that a focus event closely follows a
-// touch event, AND the bounding rectangle of the newly-focused control
-// contains the touch point, AND the focused object is a text control,
-// then Windows pops up the on-screen keyboard. In all other cases,
-// changing focus closes the on-screen keyboard.
-//
-// Alternatively:
-// 1. The user touches a text control that already has focus.
-// 2. The operating system uses accessibility APIs to query for the
-// currently focused object. If the touch falls within the bounds of
-// the focused object, the on-screen keyboard opens.
-//
-// In order to implement the accessibility APIs with minimal overhead, this
-// class builds a "fake" accessibility tree consisting of only a single root
-// node and optionally a single child node, representing the current focused
-// element in the page (if any). Every time focus changes, this fake tree is
-// sent from the renderer to the browser, along with a focus event - either
-// on the child, or on the root of the tree if nothing is focused.
-//
-// Sometimes, touching an element other than a text box will result in a
-// text box getting focus. We want the on-screen keyboard to pop up in those
-// cases, so we "cheat" more and always send the dimensions of the whole
-// window as the bounds of the child object. That way, a touch that leads
-// to a text box getting focus will always open the on-screen keyboard,
-// regardless of the relation between the touch location and the text box
-// bounds.
-class RendererAccessibilityFocusOnly : public RendererAccessibility {
- public:
- explicit RendererAccessibilityFocusOnly(RenderFrameImpl* render_frame);
- virtual ~RendererAccessibilityFocusOnly();
-
- // RendererAccessibility implementation.
- virtual void HandleWebAccessibilityEvent(
- const blink::WebAXObject& obj, blink::WebAXEvent event) override;
- virtual RendererAccessibilityType GetType() override;
- virtual void FocusedNodeChanged(const blink::WebNode& node) override;
-
- // RenderFrameObserver implementation.
- virtual void DidFinishLoad() override;
-
- private:
- void HandleFocusedNodeChanged(const blink::WebNode& node,
- bool send_focus_event);
-
- int next_id_;
-
- DISALLOW_COPY_AND_ASSIGN(RendererAccessibilityFocusOnly);
-};
-
-} // namespace content
-
-#endif // CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_FOCUS_ONLY_H_

Powered by Google App Engine
This is Rietveld 408576698