Chromium Code Reviews| 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 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1412 | 1412 |
| 1413 void RenderViewImpl::OnMoveCaret(const gfx::Point& point) { | 1413 void RenderViewImpl::OnMoveCaret(const gfx::Point& point) { |
| 1414 if (!webview()) | 1414 if (!webview()) |
| 1415 return; | 1415 return; |
| 1416 | 1416 |
| 1417 Send(new InputHostMsg_MoveCaret_ACK(routing_id_)); | 1417 Send(new InputHostMsg_MoveCaret_ACK(routing_id_)); |
| 1418 | 1418 |
| 1419 webview()->focusedFrame()->moveCaretSelection(point); | 1419 webview()->focusedFrame()->moveCaretSelection(point); |
| 1420 } | 1420 } |
| 1421 | 1421 |
| 1422 void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect( | 1422 void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect( |
|
no sievers
2015/01/29 22:01:56
Actually here it looks like (based on the generic
please use gerrit instead
2015/01/29 22:24:24
OnScrollFocusedEditableNodeIntoRect is called in t
| |
| 1423 const gfx::Rect& rect) { | 1423 const gfx::Rect& rect) { |
| 1424 if (has_scrolled_focused_editable_node_into_rect_ && | 1424 if (has_scrolled_focused_editable_node_into_rect_ && |
| 1425 rect == rect_for_scrolled_focused_editable_node_) { | 1425 rect == rect_for_scrolled_focused_editable_node_) { |
| 1426 FocusChangeComplete(); | 1426 ImeShownAnimationsComplete(); |
| 1427 return; | 1427 return; |
| 1428 } | 1428 } |
| 1429 | 1429 |
| 1430 blink::WebElement element = GetFocusedElement(); | 1430 blink::WebElement element = GetFocusedElement(); |
| 1431 bool will_animate = false; | 1431 bool will_animate = false; |
| 1432 if (!element.isNull() && IsEditableNode(element)) { | 1432 if (!element.isNull() && IsEditableNode(element)) { |
| 1433 rect_for_scrolled_focused_editable_node_ = rect; | 1433 rect_for_scrolled_focused_editable_node_ = rect; |
| 1434 has_scrolled_focused_editable_node_into_rect_ = true; | 1434 has_scrolled_focused_editable_node_into_rect_ = true; |
| 1435 will_animate = webview()->scrollFocusedNodeIntoRect(rect); | 1435 will_animate = webview()->scrollFocusedNodeIntoRect(rect); |
| 1436 } | 1436 } |
| 1437 | 1437 |
| 1438 if (!will_animate) | 1438 if (!will_animate) |
| 1439 FocusChangeComplete(); | 1439 ImeShownAnimationsComplete(); |
| 1440 } | 1440 } |
| 1441 | 1441 |
| 1442 void RenderViewImpl::OnSetEditCommandsForNextKeyEvent( | 1442 void RenderViewImpl::OnSetEditCommandsForNextKeyEvent( |
| 1443 const EditCommands& edit_commands) { | 1443 const EditCommands& edit_commands) { |
| 1444 edit_commands_ = edit_commands; | 1444 edit_commands_ = edit_commands; |
| 1445 } | 1445 } |
| 1446 | 1446 |
| 1447 void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset, | 1447 void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset, |
| 1448 int history_length) { | 1448 int history_length) { |
| 1449 DCHECK_GE(history_offset, -1); | 1449 DCHECK_GE(history_offset, -1); |
| (...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3613 // after Pepper API equips features related to surrounding text retrieval. | 3613 // after Pepper API equips features related to surrounding text retrieval. |
| 3614 gfx::Rect caret = focused_pepper_plugin_->GetCaretBounds(); | 3614 gfx::Rect caret = focused_pepper_plugin_->GetCaretBounds(); |
| 3615 *start = caret; | 3615 *start = caret; |
| 3616 *end = caret; | 3616 *end = caret; |
| 3617 return; | 3617 return; |
| 3618 } | 3618 } |
| 3619 #endif | 3619 #endif |
| 3620 RenderWidget::GetSelectionBounds(start, end); | 3620 RenderWidget::GetSelectionBounds(start, end); |
| 3621 } | 3621 } |
| 3622 | 3622 |
| 3623 void RenderViewImpl::FocusChangeComplete() { | 3623 void RenderViewImpl::ImeShownAnimationsComplete() { |
| 3624 RenderWidget::FocusChangeComplete(); | 3624 RenderWidget::ImeShownAnimationsComplete(); |
| 3625 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusChangeComplete()); | 3625 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ImeShownAnimationsComplete() ); |
| 3626 } | 3626 } |
| 3627 | 3627 |
| 3628 void RenderViewImpl::GetCompositionCharacterBounds( | 3628 void RenderViewImpl::GetCompositionCharacterBounds( |
| 3629 std::vector<gfx::Rect>* bounds) { | 3629 std::vector<gfx::Rect>* bounds) { |
| 3630 DCHECK(bounds); | 3630 DCHECK(bounds); |
| 3631 bounds->clear(); | 3631 bounds->clear(); |
| 3632 | 3632 |
| 3633 #if defined(ENABLE_PLUGINS) | 3633 #if defined(ENABLE_PLUGINS) |
| 3634 if (focused_pepper_plugin_) { | 3634 if (focused_pepper_plugin_) { |
| 3635 return; | 3635 return; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3705 | 3705 |
| 3706 void RenderViewImpl::InstrumentWillComposite() { | 3706 void RenderViewImpl::InstrumentWillComposite() { |
| 3707 if (!webview()) | 3707 if (!webview()) |
| 3708 return; | 3708 return; |
| 3709 if (!webview()->devToolsAgent()) | 3709 if (!webview()->devToolsAgent()) |
| 3710 return; | 3710 return; |
| 3711 webview()->devToolsAgent()->willComposite(); | 3711 webview()->devToolsAgent()->willComposite(); |
| 3712 } | 3712 } |
| 3713 | 3713 |
| 3714 void RenderViewImpl::DidCompletePageScaleAnimation() { | 3714 void RenderViewImpl::DidCompletePageScaleAnimation() { |
| 3715 FocusChangeComplete(); | 3715 ImeShownAnimationsComplete(); |
|
no sievers
2015/01/29 22:01:56
Also here: this is for example for double-tap zoom
please use gerrit instead
2015/01/29 22:24:24
DidCompletePageScaleAnimation is not four double-t
| |
| 3716 } | 3716 } |
| 3717 | 3717 |
| 3718 void RenderViewImpl::SetScreenMetricsEmulationParameters( | 3718 void RenderViewImpl::SetScreenMetricsEmulationParameters( |
| 3719 float device_scale_factor, | 3719 float device_scale_factor, |
| 3720 const gfx::Point& root_layer_offset, | 3720 const gfx::Point& root_layer_offset, |
| 3721 float root_layer_scale) { | 3721 float root_layer_scale) { |
| 3722 if (webview() && compositor()) { | 3722 if (webview() && compositor()) { |
| 3723 webview()->setCompositorDeviceScaleFactorOverride(device_scale_factor); | 3723 webview()->setCompositorDeviceScaleFactorOverride(device_scale_factor); |
| 3724 webview()->setRootLayerTransform( | 3724 webview()->setRootLayerTransform( |
| 3725 blink::WebSize(root_layer_offset.x(), root_layer_offset.y()), | 3725 blink::WebSize(root_layer_offset.x(), root_layer_offset.y()), |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4099 std::vector<gfx::Size> sizes; | 4099 std::vector<gfx::Size> sizes; |
| 4100 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4100 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4101 if (!url.isEmpty()) | 4101 if (!url.isEmpty()) |
| 4102 urls.push_back( | 4102 urls.push_back( |
| 4103 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4103 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4104 } | 4104 } |
| 4105 SendUpdateFaviconURL(urls); | 4105 SendUpdateFaviconURL(urls); |
| 4106 } | 4106 } |
| 4107 | 4107 |
| 4108 } // namespace content | 4108 } // namespace content |
| OLD | NEW |