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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "cc/trees/layer_tree_host.h" | 9 #include "cc/trees/layer_tree_host.h" |
10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return; | 59 return; |
60 if (compositor_) { | 60 if (compositor_) { |
61 cc::TopControlsState current = delta.height < 0 ? cc::SHOWN : cc::HIDDEN; | 61 cc::TopControlsState current = delta.height < 0 ? cc::SHOWN : cc::HIDDEN; |
62 compositor_->UpdateTopControlsState(top_controls_constraints_, | 62 compositor_->UpdateTopControlsState(top_controls_constraints_, |
63 current, | 63 current, |
64 true); | 64 true); |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 void RenderViewImpl::OnExtractSmartClipData(const gfx::Rect& rect) { | 68 void RenderViewImpl::OnExtractSmartClipData(const gfx::Rect& rect) { |
| 69 blink::WebString clip_text; |
| 70 blink::WebRect clip_rect; |
| 71 webview()->getSmartClipData(rect, &clip_text, &clip_rect); |
69 Send(new ViewHostMsg_SmartClipDataExtracted( | 72 Send(new ViewHostMsg_SmartClipDataExtracted( |
70 routing_id_, webview()->getSmartClipData(rect))); | 73 routing_id_, clip_text, clip_rect)); |
71 } | 74 } |
72 | 75 |
73 void RenderViewImpl::GetSelectionRootBounds(gfx::Rect* bounds) const { | 76 void RenderViewImpl::GetSelectionRootBounds(gfx::Rect* bounds) const { |
74 blink::WebRect bounds_webrect; | 77 blink::WebRect bounds_webrect; |
75 webview()->getSelectionRootBounds(bounds_webrect); | 78 webview()->getSelectionRootBounds(bounds_webrect); |
76 *bounds = bounds_webrect; | 79 *bounds = bounds_webrect; |
77 } | 80 } |
78 | 81 |
79 void RenderViewImpl::UpdateSelectionRootBounds() { | 82 void RenderViewImpl::UpdateSelectionRootBounds() { |
80 if (!webview() || handling_ime_event_) | 83 if (!webview() || handling_ime_event_) |
81 return; | 84 return; |
82 | 85 |
83 gfx::Rect bounds; | 86 gfx::Rect bounds; |
84 GetSelectionRootBounds(&bounds); | 87 GetSelectionRootBounds(&bounds); |
85 if (selection_root_rect_ != bounds) { | 88 if (selection_root_rect_ != bounds) { |
86 selection_root_rect_ = bounds; | 89 selection_root_rect_ = bounds; |
87 Send(new ViewHostMsg_SelectionRootBoundsChanged(routing_id_, bounds)); | 90 Send(new ViewHostMsg_SelectionRootBoundsChanged(routing_id_, bounds)); |
88 } | 91 } |
89 } | 92 } |
90 | 93 |
91 } // namespace content | 94 } // namespace content |
OLD | NEW |