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 Send(new ViewHostMsg_SmartClipDataExtracted( | 69 webview()->getSmartClipData(rect); |
70 routing_id_, webview()->getSmartClipData(rect))); | 70 } |
71 | |
72 void RenderViewImpl::updateSmartClipDataResult(const blink::WebString& text, | |
73 const blink::WebRect& rect) { | |
74 ViewHostMsg_SmartClip_Params params; | |
jam
2014/04/30 16:05:47
we only create IPC structs when we have more than
AviD
2014/05/02 15:04:45
Removed IPC struct.
| |
75 params.clip_rect = rect; | |
76 params.clip_data = text; | |
77 Send(new ViewHostMsg_SmartClipDataExtracted(routing_id_, params)); | |
71 } | 78 } |
72 | 79 |
73 void RenderViewImpl::GetSelectionRootBounds(gfx::Rect* bounds) const { | 80 void RenderViewImpl::GetSelectionRootBounds(gfx::Rect* bounds) const { |
74 blink::WebRect bounds_webrect; | 81 blink::WebRect bounds_webrect; |
75 webview()->getSelectionRootBounds(bounds_webrect); | 82 webview()->getSelectionRootBounds(bounds_webrect); |
76 *bounds = bounds_webrect; | 83 *bounds = bounds_webrect; |
77 } | 84 } |
78 | 85 |
79 void RenderViewImpl::UpdateSelectionRootBounds() { | 86 void RenderViewImpl::UpdateSelectionRootBounds() { |
80 if (!webview() || handling_ime_event_) | 87 if (!webview() || handling_ime_event_) |
81 return; | 88 return; |
82 | 89 |
83 gfx::Rect bounds; | 90 gfx::Rect bounds; |
84 GetSelectionRootBounds(&bounds); | 91 GetSelectionRootBounds(&bounds); |
85 if (selection_root_rect_ != bounds) { | 92 if (selection_root_rect_ != bounds) { |
86 selection_root_rect_ = bounds; | 93 selection_root_rect_ = bounds; |
87 Send(new ViewHostMsg_SelectionRootBoundsChanged(routing_id_, bounds)); | 94 Send(new ViewHostMsg_SelectionRootBoundsChanged(routing_id_, bounds)); |
88 } | 95 } |
89 } | 96 } |
90 | 97 |
91 } // namespace content | 98 } // namespace content |
OLD | NEW |