| 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" | |
| 13 #include "third_party/WebKit/public/web/WebView.h" | 12 #include "third_party/WebKit/public/web/WebView.h" |
| 14 | 13 |
| 15 namespace content { | 14 namespace content { |
| 16 | 15 |
| 17 // Check content::TopControlsState and cc::TopControlsState are kept in sync. | 16 // Check content::TopControlsState and cc::TopControlsState are kept in sync. |
| 18 COMPILE_ASSERT(int(SHOWN) == int(cc::SHOWN), mismatching_enums); | 17 COMPILE_ASSERT(int(SHOWN) == int(cc::SHOWN), mismatching_enums); |
| 19 COMPILE_ASSERT(int(HIDDEN) == int(cc::HIDDEN), mismatching_enums); | 18 COMPILE_ASSERT(int(HIDDEN) == int(cc::HIDDEN), mismatching_enums); |
| 20 COMPILE_ASSERT(int(BOTH) == int(cc::BOTH), mismatching_enums); | 19 COMPILE_ASSERT(int(BOTH) == int(cc::BOTH), mismatching_enums); |
| 21 | 20 |
| 22 cc::TopControlsState ContentToCcTopControlsState( | 21 cc::TopControlsState ContentToCcTopControlsState( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 current, | 62 current, |
| 64 true); | 63 true); |
| 65 } | 64 } |
| 66 } | 65 } |
| 67 | 66 |
| 68 void RenderViewImpl::OnExtractSmartClipData(const gfx::Rect& rect) { | 67 void RenderViewImpl::OnExtractSmartClipData(const gfx::Rect& rect) { |
| 69 Send(new ViewHostMsg_SmartClipDataExtracted( | 68 Send(new ViewHostMsg_SmartClipDataExtracted( |
| 70 routing_id_, webview()->getSmartClipData(rect))); | 69 routing_id_, webview()->getSmartClipData(rect))); |
| 71 } | 70 } |
| 72 | 71 |
| 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 | |
| 91 } // namespace content | 72 } // namespace content |
| OLD | NEW |