| OLD | NEW |
| 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/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 // If we change the zoom level for the view, make sure any subsequent subframe | 1684 // If we change the zoom level for the view, make sure any subsequent subframe |
| 1685 // loads reflect the current zoom level. | 1685 // loads reflect the current zoom level. |
| 1686 page_zoom_level_ = zoom_level; | 1686 page_zoom_level_ = zoom_level; |
| 1687 | 1687 |
| 1688 webview()->setZoomLevel(zoom_level); | 1688 webview()->setZoomLevel(zoom_level); |
| 1689 for (auto& observer : observers_) | 1689 for (auto& observer : observers_) |
| 1690 observer.OnZoomLevelChanged(); | 1690 observer.OnZoomLevelChanged(); |
| 1691 } | 1691 } |
| 1692 | 1692 |
| 1693 void RenderViewImpl::didCancelCompositionOnSelectionChange() { | 1693 void RenderViewImpl::didCancelCompositionOnSelectionChange() { |
| 1694 Send(new InputHostMsg_ImeCancelComposition(GetRoutingID())); | 1694 GetWidget()->CancelComposition(); |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 void RenderViewImpl::SetValidationMessageDirection( | 1697 void RenderViewImpl::SetValidationMessageDirection( |
| 1698 base::string16* wrapped_main_text, | 1698 base::string16* wrapped_main_text, |
| 1699 blink::WebTextDirection main_text_hint, | 1699 blink::WebTextDirection main_text_hint, |
| 1700 base::string16* wrapped_sub_text, | 1700 base::string16* wrapped_sub_text, |
| 1701 blink::WebTextDirection sub_text_hint) { | 1701 blink::WebTextDirection sub_text_hint) { |
| 1702 if (main_text_hint == blink::WebTextDirectionLeftToRight) { | 1702 if (main_text_hint == blink::WebTextDirectionLeftToRight) { |
| 1703 *wrapped_main_text = | 1703 *wrapped_main_text = |
| 1704 base::i18n::GetDisplayStringInLTRDirectionality(*wrapped_main_text); | 1704 base::i18n::GetDisplayStringInLTRDirectionality(*wrapped_main_text); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 | 1856 |
| 1857 gfx::Rect node_bounds; | 1857 gfx::Rect node_bounds; |
| 1858 bool is_editable = false; | 1858 bool is_editable = false; |
| 1859 if (!toNode.isNull() && toNode.isElementNode()) { | 1859 if (!toNode.isNull() && toNode.isElementNode()) { |
| 1860 WebElement element = const_cast<WebNode&>(toNode).to<WebElement>(); | 1860 WebElement element = const_cast<WebNode&>(toNode).to<WebElement>(); |
| 1861 blink::WebRect rect = element.boundsInViewport(); | 1861 blink::WebRect rect = element.boundsInViewport(); |
| 1862 ConvertViewportToWindowViaWidget(&rect); | 1862 ConvertViewportToWindowViaWidget(&rect); |
| 1863 node_bounds = gfx::Rect(rect); | 1863 node_bounds = gfx::Rect(rect); |
| 1864 is_editable = element.isEditable(); | 1864 is_editable = element.isEditable(); |
| 1865 } | 1865 } |
| 1866 Send(new ViewHostMsg_FocusedNodeChanged(GetRoutingID(), is_editable, | 1866 |
| 1867 node_bounds)); | 1867 GetWidget()->OnFocusedNodeChanged(is_editable, node_bounds); |
| 1868 | 1868 |
| 1869 // TODO(estade): remove. | 1869 // TODO(estade): remove. |
| 1870 for (auto& observer : observers_) | 1870 for (auto& observer : observers_) |
| 1871 observer.FocusedNodeChanged(toNode); | 1871 observer.FocusedNodeChanged(toNode); |
| 1872 | 1872 |
| 1873 RenderFrameImpl* previous_frame = nullptr; | 1873 RenderFrameImpl* previous_frame = nullptr; |
| 1874 if (!fromNode.isNull()) | 1874 if (!fromNode.isNull()) |
| 1875 previous_frame = RenderFrameImpl::FromWebFrame(fromNode.document().frame()); | 1875 previous_frame = RenderFrameImpl::FromWebFrame(fromNode.document().frame()); |
| 1876 RenderFrameImpl* new_frame = nullptr; | 1876 RenderFrameImpl* new_frame = nullptr; |
| 1877 if (!toNode.isNull()) | 1877 if (!toNode.isNull()) |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3042 NotifyInputEventHandled(input_event->type, | 3042 NotifyInputEventHandled(input_event->type, |
| 3043 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 3043 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 3044 } | 3044 } |
| 3045 | 3045 |
| 3046 std::unique_ptr<InputEventAck> ack( | 3046 std::unique_ptr<InputEventAck> ack( |
| 3047 new InputEventAck(input_event->type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 3047 new InputEventAck(input_event->type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| 3048 OnInputEventAck(std::move(ack)); | 3048 OnInputEventAck(std::move(ack)); |
| 3049 } | 3049 } |
| 3050 | 3050 |
| 3051 } // namespace content | 3051 } // namespace content |
| OLD | NEW |