| OLD | NEW |
| 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 Loading... |
| 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(); | |
| 5150 | 5147 |
| 5151 for (auto& observer : observers_) | 5148 for (auto& observer : observers_) |
| 5152 observer.FocusedNodeChanged(node); | 5149 observer.FocusedNodeChanged(node); |
| 5153 } | 5150 } |
| 5154 | 5151 |
| 5155 void RenderFrameImpl::FocusedNodeChangedForAccessibility(const WebNode& node) { | 5152 void RenderFrameImpl::FocusedNodeChangedForAccessibility(const WebNode& node) { |
| 5156 if (render_accessibility()) | 5153 if (render_accessibility()) |
| 5157 render_accessibility()->AccessibilityFocusedNodeChanged(node); | 5154 render_accessibility()->AccessibilityFocusedNodeChanged(node); |
| 5158 } | 5155 } |
| 5159 | 5156 |
| (...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6870 // event target. Potentially a Pepper plugin will receive the event. | 6867 // event target. Potentially a Pepper plugin will receive the event. |
| 6871 // In order to tell whether a plugin gets the last mouse event and which it | 6868 // In order to tell whether a plugin gets the last mouse event and which it |
| 6872 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6869 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6873 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6870 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6874 // |pepper_last_mouse_event_target_|. | 6871 // |pepper_last_mouse_event_target_|. |
| 6875 pepper_last_mouse_event_target_ = nullptr; | 6872 pepper_last_mouse_event_target_ = nullptr; |
| 6876 #endif | 6873 #endif |
| 6877 } | 6874 } |
| 6878 | 6875 |
| 6879 } // namespace content | 6876 } // namespace content |
| OLD | NEW |