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

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

Issue 2466283002: [WIP Approach 2] Straighten up input method reactivation
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 // If we change the zoom level for the view, make sure any subsequent subframe 1677 // If we change the zoom level for the view, make sure any subsequent subframe
1678 // loads reflect the current zoom level. 1678 // loads reflect the current zoom level.
1679 page_zoom_level_ = zoom_level; 1679 page_zoom_level_ = zoom_level;
1680 1680
1681 webview()->setZoomLevel(zoom_level); 1681 webview()->setZoomLevel(zoom_level);
1682 for (auto& observer : observers_) 1682 for (auto& observer : observers_)
1683 observer.OnZoomLevelChanged(); 1683 observer.OnZoomLevelChanged();
1684 } 1684 }
1685 1685
1686 void RenderViewImpl::didCancelCompositionOnSelectionChange() { 1686 void RenderViewImpl::didCancelCompositionOnSelectionChange() {
1687 Send(new InputHostMsg_ImeCancelComposition(GetRoutingID())); 1687 GetWidget()->CancelComposition();
1688 } 1688 }
1689 1689
1690 void RenderViewImpl::SetValidationMessageDirection( 1690 void RenderViewImpl::SetValidationMessageDirection(
1691 base::string16* wrapped_main_text, 1691 base::string16* wrapped_main_text,
1692 blink::WebTextDirection main_text_hint, 1692 blink::WebTextDirection main_text_hint,
1693 base::string16* wrapped_sub_text, 1693 base::string16* wrapped_sub_text,
1694 blink::WebTextDirection sub_text_hint) { 1694 blink::WebTextDirection sub_text_hint) {
1695 if (main_text_hint == blink::WebTextDirectionLeftToRight) { 1695 if (main_text_hint == blink::WebTextDirectionLeftToRight) {
1696 *wrapped_main_text = 1696 *wrapped_main_text =
1697 base::i18n::GetDisplayStringInLTRDirectionality(*wrapped_main_text); 1697 base::i18n::GetDisplayStringInLTRDirectionality(*wrapped_main_text);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1849 1849
1850 gfx::Rect node_bounds; 1850 gfx::Rect node_bounds;
1851 bool is_editable = false; 1851 bool is_editable = false;
1852 if (!toNode.isNull() && toNode.isElementNode()) { 1852 if (!toNode.isNull() && toNode.isElementNode()) {
1853 WebElement element = const_cast<WebNode&>(toNode).to<WebElement>(); 1853 WebElement element = const_cast<WebNode&>(toNode).to<WebElement>();
1854 blink::WebRect rect = element.boundsInViewport(); 1854 blink::WebRect rect = element.boundsInViewport();
1855 ConvertViewportToWindowViaWidget(&rect); 1855 ConvertViewportToWindowViaWidget(&rect);
1856 node_bounds = gfx::Rect(rect); 1856 node_bounds = gfx::Rect(rect);
1857 is_editable = element.isEditable(); 1857 is_editable = element.isEditable();
1858 } 1858 }
1859 Send(new ViewHostMsg_FocusedNodeChanged(GetRoutingID(), is_editable, 1859
1860 node_bounds)); 1860 GetWidget()->OnFocusedNodeChanged(is_editable, node_bounds);
1861 1861
1862 // TODO(estade): remove. 1862 // TODO(estade): remove.
1863 for (auto& observer : observers_) 1863 for (auto& observer : observers_)
1864 observer.FocusedNodeChanged(toNode); 1864 observer.FocusedNodeChanged(toNode);
1865 1865
1866 RenderFrameImpl* previous_frame = nullptr; 1866 RenderFrameImpl* previous_frame = nullptr;
1867 if (!fromNode.isNull()) 1867 if (!fromNode.isNull())
1868 previous_frame = RenderFrameImpl::FromWebFrame(fromNode.document().frame()); 1868 previous_frame = RenderFrameImpl::FromWebFrame(fromNode.document().frame());
1869 RenderFrameImpl* new_frame = nullptr; 1869 RenderFrameImpl* new_frame = nullptr;
1870 if (!toNode.isNull()) 1870 if (!toNode.isNull())
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
3031 if (IsUseZoomForDSFEnabled()) { 3031 if (IsUseZoomForDSFEnabled()) {
3032 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3032 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3033 } else { 3033 } else {
3034 webview()->setDeviceScaleFactor(device_scale_factor_); 3034 webview()->setDeviceScaleFactor(device_scale_factor_);
3035 } 3035 }
3036 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3036 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3037 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3037 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3038 } 3038 }
3039 3039
3040 } // namespace content 3040 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698