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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2681833006: [Android] Restart input only once on focus change (Closed)
Patch Set: fixed nit Created 3 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 5096 matching lines...) Expand 10 before | Expand all | Expand 10 after
5107 gfx::Rect node_bounds; 5107 gfx::Rect node_bounds;
5108 if (!node.isNull() && node.isElementNode()) { 5108 if (!node.isNull() && node.isElementNode()) {
5109 WebElement element = const_cast<WebNode&>(node).to<WebElement>(); 5109 WebElement element = const_cast<WebNode&>(node).to<WebElement>();
5110 blink::WebRect rect = element.boundsInViewport(); 5110 blink::WebRect rect = element.boundsInViewport();
5111 GetRenderWidget()->convertViewportToWindow(&rect); 5111 GetRenderWidget()->convertViewportToWindow(&rect);
5112 is_editable = element.isEditable(); 5112 is_editable = element.isEditable();
5113 node_bounds = gfx::Rect(rect); 5113 node_bounds = gfx::Rect(rect);
5114 } 5114 }
5115 Send(new FrameHostMsg_FocusedNodeChanged(routing_id_, is_editable, 5115 Send(new FrameHostMsg_FocusedNodeChanged(routing_id_, is_editable,
5116 node_bounds)); 5116 node_bounds));
5117 // Ensures that further text input state can be sent even when previously
5118 // focused input and the newly focused input share the exact same state.
5119 GetRenderWidget()->ClearTextInputState();
5117 5120
5118 for (auto& observer : observers_) 5121 for (auto& observer : observers_)
5119 observer.FocusedNodeChanged(node); 5122 observer.FocusedNodeChanged(node);
5120 } 5123 }
5121 5124
5122 void RenderFrameImpl::FocusedNodeChangedForAccessibility(const WebNode& node) { 5125 void RenderFrameImpl::FocusedNodeChangedForAccessibility(const WebNode& node) {
5123 if (render_accessibility()) 5126 if (render_accessibility())
5124 render_accessibility()->AccessibilityFocusedNodeChanged(node); 5127 render_accessibility()->AccessibilityFocusedNodeChanged(node);
5125 } 5128 }
5126 5129
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after
6850 // event target. Potentially a Pepper plugin will receive the event. 6853 // event target. Potentially a Pepper plugin will receive the event.
6851 // In order to tell whether a plugin gets the last mouse event and which it 6854 // In order to tell whether a plugin gets the last mouse event and which it
6852 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6855 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6853 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6856 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6854 // |pepper_last_mouse_event_target_|. 6857 // |pepper_last_mouse_event_target_|.
6855 pepper_last_mouse_event_target_ = nullptr; 6858 pepper_last_mouse_event_target_ = nullptr;
6856 #endif 6859 #endif
6857 } 6860 }
6858 6861
6859 } // namespace content 6862 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/render_widget_input_handler_delegate.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698