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" |
11 #include "content/renderer/gpu/render_widget_compositor.h" | 11 #include "content/renderer/gpu/render_widget_compositor.h" |
| 12 #include "third_party/WebKit/public/platform/WebRect.h" |
12 #include "third_party/WebKit/public/web/WebView.h" | 13 #include "third_party/WebKit/public/web/WebView.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 // Check content::TopControlsState and cc::TopControlsState are kept in sync. | 17 // Check content::TopControlsState and cc::TopControlsState are kept in sync. |
17 COMPILE_ASSERT(int(SHOWN) == int(cc::SHOWN), mismatching_enums); | 18 COMPILE_ASSERT(int(SHOWN) == int(cc::SHOWN), mismatching_enums); |
18 COMPILE_ASSERT(int(HIDDEN) == int(cc::HIDDEN), mismatching_enums); | 19 COMPILE_ASSERT(int(HIDDEN) == int(cc::HIDDEN), mismatching_enums); |
19 COMPILE_ASSERT(int(BOTH) == int(cc::BOTH), mismatching_enums); | 20 COMPILE_ASSERT(int(BOTH) == int(cc::BOTH), mismatching_enums); |
20 | 21 |
21 cc::TopControlsState ContentToCcTopControlsState( | 22 cc::TopControlsState ContentToCcTopControlsState( |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 current, | 63 current, |
63 true); | 64 true); |
64 } | 65 } |
65 } | 66 } |
66 | 67 |
67 void RenderViewImpl::OnExtractSmartClipData(const gfx::Rect& rect) { | 68 void RenderViewImpl::OnExtractSmartClipData(const gfx::Rect& rect) { |
68 Send(new ViewHostMsg_SmartClipDataExtracted( | 69 Send(new ViewHostMsg_SmartClipDataExtracted( |
69 routing_id_, webview()->getSmartClipData(rect))); | 70 routing_id_, webview()->getSmartClipData(rect))); |
70 } | 71 } |
71 | 72 |
| 73 void RenderViewImpl::GetSelectionRootBounds(gfx::Rect* bounds) const { |
| 74 blink::WebRect bounds_webrect; |
| 75 webview()->getSelectionRootBounds(bounds_webrect); |
| 76 *bounds = bounds_webrect; |
| 77 } |
| 78 |
| 79 void RenderViewImpl::UpdateSelectionRootBounds() { |
| 80 if (!webview() || handling_ime_event_) |
| 81 return; |
| 82 |
| 83 gfx::Rect bounds; |
| 84 GetSelectionRootBounds(&bounds); |
| 85 if (selection_root_rect_ != bounds) { |
| 86 selection_root_rect_ = bounds; |
| 87 Send(new ViewHostMsg_SelectionRootBoundsChanged(routing_id_, bounds)); |
| 88 } |
| 89 } |
| 90 |
72 } // namespace content | 91 } // namespace content |
OLD | NEW |