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

Side by Side Diff: content/renderer/accessibility/renderer_accessibility_focus_only.cc

Issue 184933002: Move to using focusedElement instead of focusedNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/accessibility/renderer_accessibility_focus_only.h" 5 #include "content/renderer/accessibility/renderer_accessibility_focus_only.h"
6 6
7 #include "content/renderer/render_view_impl.h" 7 #include "content/renderer/render_view_impl.h"
8 #include "third_party/WebKit/public/web/WebDocument.h" 8 #include "third_party/WebKit/public/web/WebDocument.h"
9 #include "third_party/WebKit/public/web/WebElement.h" 9 #include "third_party/WebKit/public/web/WebElement.h"
10 #include "third_party/WebKit/public/web/WebFrame.h" 10 #include "third_party/WebKit/public/web/WebFrame.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void RendererAccessibilityFocusOnly::DidFinishLoad(blink::WebFrame* frame) { 48 void RendererAccessibilityFocusOnly::DidFinishLoad(blink::WebFrame* frame) {
49 WebView* view = render_view()->GetWebView(); 49 WebView* view = render_view()->GetWebView();
50 if (view->focusedFrame() != frame) 50 if (view->focusedFrame() != frame)
51 return; 51 return;
52 52
53 WebDocument document = frame->document(); 53 WebDocument document = frame->document();
54 // Send an accessible tree to the browser, but do not post a native 54 // Send an accessible tree to the browser, but do not post a native
55 // focus event. This is important so that if focus is initially in an 55 // focus event. This is important so that if focus is initially in an
56 // editable text field, Windows will know to pop up the keyboard if the 56 // editable text field, Windows will know to pop up the keyboard if the
57 // user touches it and focus doesn't change. 57 // user touches it and focus doesn't change.
58 HandleFocusedNodeChanged(document.focusedNode(), false); 58 HandleFocusedNodeChanged(document.focusedElement(), false);
59 } 59 }
60 60
61 void RendererAccessibilityFocusOnly::HandleFocusedNodeChanged( 61 void RendererAccessibilityFocusOnly::HandleFocusedNodeChanged(
62 const WebNode& node, 62 const WebNode& node,
63 bool send_focus_event) { 63 bool send_focus_event) {
64 const WebDocument& document = GetMainDocument(); 64 const WebDocument& document = GetMainDocument();
65 if (document.isNull()) 65 if (document.isNull())
66 return; 66 return;
67 67
68 bool node_has_focus; 68 bool node_has_focus;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 Send(new AccessibilityHostMsg_Events(routing_id(), events)); 143 Send(new AccessibilityHostMsg_Events(routing_id(), events));
144 144
145 // Increment the id, wrap back when we get past a million. 145 // Increment the id, wrap back when we get past a million.
146 next_id_++; 146 next_id_++;
147 if (next_id_ > 1000000) 147 if (next_id_ > 1000000)
148 next_id_ = kInitialId; 148 next_id_ = kInitialId;
149 } 149 }
150 150
151 } // namespace content 151 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698