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

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

Issue 222973003: Conversion of content_shell target to use WebLocalFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove some TODOs Created 6 years, 8 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 | Annotate | Revision Log
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 RendererAccessibilityType RendererAccessibilityFocusOnly::GetType() { 43 RendererAccessibilityType RendererAccessibilityFocusOnly::GetType() {
44 return RendererAccessibilityTypeFocusOnly; 44 return RendererAccessibilityTypeFocusOnly;
45 } 45 }
46 46
47 void RendererAccessibilityFocusOnly::FocusedNodeChanged(const WebNode& node) { 47 void RendererAccessibilityFocusOnly::FocusedNodeChanged(const WebNode& node) {
48 // Send the new accessible tree and post a native focus event. 48 // Send the new accessible tree and post a native focus event.
49 HandleFocusedNodeChanged(node, true); 49 HandleFocusedNodeChanged(node, true);
50 } 50 }
51 51
52 void RendererAccessibilityFocusOnly::DidFinishLoad(blink::WebFrame* frame) { 52 void RendererAccessibilityFocusOnly::DidFinishLoad(
53 blink::WebLocalFrame* frame) {
53 WebView* view = render_view()->GetWebView(); 54 WebView* view = render_view()->GetWebView();
54 if (view->focusedFrame() != frame) 55 if (view->focusedFrame() != frame)
55 return; 56 return;
56 57
57 WebDocument document = frame->document(); 58 WebDocument document = frame->document();
58 // Send an accessible tree to the browser, but do not post a native 59 // Send an accessible tree to the browser, but do not post a native
59 // focus event. This is important so that if focus is initially in an 60 // focus event. This is important so that if focus is initially in an
60 // editable text field, Windows will know to pop up the keyboard if the 61 // editable text field, Windows will know to pop up the keyboard if the
61 // user touches it and focus doesn't change. 62 // user touches it and focus doesn't change.
62 HandleFocusedNodeChanged(document.focusedElement(), false); 63 HandleFocusedNodeChanged(document.focusedElement(), false);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 147
147 Send(new AccessibilityHostMsg_Events(routing_id(), events)); 148 Send(new AccessibilityHostMsg_Events(routing_id(), events));
148 149
149 // Increment the id, wrap back when we get past a million. 150 // Increment the id, wrap back when we get past a million.
150 next_id_++; 151 next_id_++;
151 if (next_id_ > 1000000) 152 if (next_id_ > 1000000)
152 next_id_ = kInitialId; 153 next_id_ = kInitialId;
153 } 154 }
154 155
155 } // namespace content 156 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698