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

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

Issue 2736413002: [Android] Restart input only once on focus change (Closed)
Patch Set: Rebase Created 3 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
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 5126 matching lines...) Expand 10 before | Expand all | Expand 10 after
5137 gfx::Rect node_bounds; 5137 gfx::Rect node_bounds;
5138 if (!node.isNull() && node.isElementNode()) { 5138 if (!node.isNull() && node.isElementNode()) {
5139 WebElement element = const_cast<WebNode&>(node).to<WebElement>(); 5139 WebElement element = const_cast<WebNode&>(node).to<WebElement>();
5140 blink::WebRect rect = element.boundsInViewport(); 5140 blink::WebRect rect = element.boundsInViewport();
5141 GetRenderWidget()->convertViewportToWindow(&rect); 5141 GetRenderWidget()->convertViewportToWindow(&rect);
5142 is_editable = element.isEditable(); 5142 is_editable = element.isEditable();
5143 node_bounds = gfx::Rect(rect); 5143 node_bounds = gfx::Rect(rect);
5144 } 5144 }
5145 Send(new FrameHostMsg_FocusedNodeChanged(routing_id_, is_editable, 5145 Send(new FrameHostMsg_FocusedNodeChanged(routing_id_, is_editable,
5146 node_bounds)); 5146 node_bounds));
5147 // Ensures that further text input state can be sent even when previously
5148 // focused input and the newly focused input share the exact same state.
5149 GetRenderWidget()->ClearTextInputState();
5147 5150
5148 for (auto& observer : observers_) 5151 for (auto& observer : observers_)
5149 observer.FocusedNodeChanged(node); 5152 observer.FocusedNodeChanged(node);
5150 } 5153 }
5151 5154
5152 void RenderFrameImpl::FocusedNodeChangedForAccessibility(const WebNode& node) { 5155 void RenderFrameImpl::FocusedNodeChangedForAccessibility(const WebNode& node) {
5153 if (render_accessibility()) 5156 if (render_accessibility())
5154 render_accessibility()->AccessibilityFocusedNodeChanged(node); 5157 render_accessibility()->AccessibilityFocusedNodeChanged(node);
5155 } 5158 }
5156 5159
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after
6867 // event target. Potentially a Pepper plugin will receive the event. 6870 // event target. Potentially a Pepper plugin will receive the event.
6868 // In order to tell whether a plugin gets the last mouse event and which it 6871 // In order to tell whether a plugin gets the last mouse event and which it
6869 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6872 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6870 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6873 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6871 // |pepper_last_mouse_event_target_|. 6874 // |pepper_last_mouse_event_target_|.
6872 pepper_last_mouse_event_target_ = nullptr; 6875 pepper_last_mouse_event_target_ = nullptr;
6873 #endif 6876 #endif
6874 } 6877 }
6875 6878
6876 } // namespace content 6879 } // 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