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

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

Issue 273423004: Migrate accessibility from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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.cc
diff --git a/content/renderer/accessibility/renderer_accessibility_focus_only.cc b/content/renderer/accessibility/renderer_accessibility_focus_only.cc
index bda3e8f73a32ee165caeab774bbe7a70f921adcb..b1ada1f4f577e321468aeba7f064b389074546b0 100644
--- a/content/renderer/accessibility/renderer_accessibility_focus_only.cc
+++ b/content/renderer/accessibility/renderer_accessibility_focus_only.cc
@@ -4,6 +4,7 @@
#include "content/renderer/accessibility/renderer_accessibility_focus_only.h"
+#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_view_impl.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
@@ -26,8 +27,8 @@ const int kInitialId = 2;
namespace content {
RendererAccessibilityFocusOnly::RendererAccessibilityFocusOnly(
- RenderViewImpl* render_view)
- : RendererAccessibility(render_view),
+ RenderFrameImpl* render_frame)
+ : RendererAccessibility(render_frame),
next_id_(kInitialId) {
}
@@ -50,7 +51,7 @@ void RendererAccessibilityFocusOnly::FocusedNodeChanged(const WebNode& node) {
void RendererAccessibilityFocusOnly::DidFinishLoad(
blink::WebLocalFrame* frame) {
- WebView* view = render_view()->GetWebView();
+ WebView* view = render_frame_->render_view()->GetWebView();
if (view->focusedFrame() != frame)
return;
@@ -74,13 +75,13 @@ void RendererAccessibilityFocusOnly::HandleFocusedNodeChanged(
// Check HasIMETextFocus first, because it will correctly handle
// focus in a text box inside a ppapi plug-in. Otherwise fall back on
// checking the focused node in Blink.
- if (render_view_->HasIMETextFocus()) {
+ if (render_frame_->render_view()->HasIMETextFocus()) {
node_has_focus = true;
node_is_editable_text = true;
} else {
node_has_focus = !node.isNull();
node_is_editable_text =
- node_has_focus && render_view_->IsEditableNode(node);
+ node_has_focus && render_frame_->render_view()->IsEditableNode(node);
}
std::vector<AccessibilityHostMsg_EventParams> events;
@@ -109,7 +110,7 @@ void RendererAccessibilityFocusOnly::HandleFocusedNodeChanged(
(1 << ui::AX_STATE_FOCUSABLE);
if (!node_has_focus)
root.state |= (1 << ui::AX_STATE_FOCUSED);
- root.location = gfx::Rect(render_view_->size());
+ root.location = gfx::Rect(render_frame_->render_view()->size());
root.child_ids.push_back(next_id_);
child.id = next_id_;
@@ -118,7 +119,7 @@ void RendererAccessibilityFocusOnly::HandleFocusedNodeChanged(
if (!node.isNull() && node.isElementNode()) {
child.location = gfx::Rect(
const_cast<WebNode&>(node).to<WebElement>().boundsInViewportSpace());
- } else if (render_view_->HasIMETextFocus()) {
+ } else if (render_frame_->render_view()->HasIMETextFocus()) {
child.location = root.location;
} else {
child.location = gfx::Rect();

Powered by Google App Engine
This is Rietveld 408576698