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

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

Issue 1589953005: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed #36. Added ImeLollipopTest for IMMEDIATE case. Created 4 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 (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_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 OnShowImeIfNeeded(); 1539 OnShowImeIfNeeded();
1540 } 1540 }
1541 1541
1542 ui::TextInputType RenderWidget::GetTextInputType() { 1542 ui::TextInputType RenderWidget::GetTextInputType() {
1543 if (webwidget_) 1543 if (webwidget_)
1544 return WebKitToUiTextInputType(webwidget_->textInputType()); 1544 return WebKitToUiTextInputType(webwidget_->textInputType());
1545 return ui::TEXT_INPUT_TYPE_NONE; 1545 return ui::TEXT_INPUT_TYPE_NONE;
1546 } 1546 }
1547 1547
1548 void RenderWidget::UpdateCompositionInfo(bool should_update_range) { 1548 void RenderWidget::UpdateCompositionInfo(bool should_update_range) {
1549 #if defined(OS_ANDROID)
1550 // TODO(yukawa): Start sending character bounds when the browser side
1551 // implementation becomes ready (crbug.com/424866).
1552 #else
1553 TRACE_EVENT0("renderer", "RenderWidget::UpdateCompositionInfo"); 1549 TRACE_EVENT0("renderer", "RenderWidget::UpdateCompositionInfo");
1554 gfx::Range range = gfx::Range(); 1550 gfx::Range range = gfx::Range();
1555 if (should_update_range) { 1551 if (should_update_range) {
1556 GetCompositionRange(&range); 1552 GetCompositionRange(&range);
1557 } else { 1553 } else {
1558 range = composition_range_; 1554 range = composition_range_;
1559 } 1555 }
1560 std::vector<gfx::Rect> character_bounds; 1556 std::vector<gfx::Rect> character_bounds;
1561 GetCompositionCharacterBounds(&character_bounds); 1557 GetCompositionCharacterBounds(&character_bounds);
1562 1558
1563 if (!ShouldUpdateCompositionInfo(range, character_bounds)) 1559 if (!ShouldUpdateCompositionInfo(range, character_bounds))
1564 return; 1560 return;
1565 composition_character_bounds_ = character_bounds; 1561 composition_character_bounds_ = character_bounds;
1566 composition_range_ = range; 1562 composition_range_ = range;
1567 Send(new InputHostMsg_ImeCompositionRangeChanged( 1563 Send(new InputHostMsg_ImeCompositionRangeChanged(
1568 routing_id(), composition_range_, composition_character_bounds_)); 1564 routing_id(), composition_range_, composition_character_bounds_));
1569 #endif
1570 } 1565 }
1571 1566
1572 void RenderWidget::convertViewportToWindow(blink::WebRect* rect) { 1567 void RenderWidget::convertViewportToWindow(blink::WebRect* rect) {
1573 if (IsUseZoomForDSFEnabled()) { 1568 if (IsUseZoomForDSFEnabled()) {
1574 float reverse = 1 / device_scale_factor_; 1569 float reverse = 1 / device_scale_factor_;
1575 // TODO(oshima): We may need to allow pixel precision here as the the 1570 // TODO(oshima): We may need to allow pixel precision here as the the
1576 // anchor element can be placed at half pixel. 1571 // anchor element can be placed at half pixel.
1577 gfx::Rect window_rect = 1572 gfx::Rect window_rect =
1578 gfx::ScaleToEnclosedRect(gfx::Rect(*rect), reverse); 1573 gfx::ScaleToEnclosedRect(gfx::Rect(*rect), reverse);
1579 rect->x = window_rect.x(); 1574 rect->x = window_rect.x();
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 video_hole_frames_.RemoveObserver(frame); 2108 video_hole_frames_.RemoveObserver(frame);
2114 } 2109 }
2115 #endif // defined(VIDEO_HOLE) 2110 #endif // defined(VIDEO_HOLE)
2116 2111
2117 void RenderWidget::OnWaitNextFrameForTests(int routing_id) { 2112 void RenderWidget::OnWaitNextFrameForTests(int routing_id) {
2118 QueueMessage(new ViewHostMsg_WaitForNextFrameForTests_ACK(routing_id), 2113 QueueMessage(new ViewHostMsg_WaitForNextFrameForTests_ACK(routing_id),
2119 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); 2114 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE);
2120 } 2115 }
2121 2116
2122 } // namespace content 2117 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698