| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 if (!enable_hiding) | 44 if (!enable_hiding) |
| 45 constraints = TOP_CONTROLS_STATE_SHOWN; | 45 constraints = TOP_CONTROLS_STATE_SHOWN; |
| 46 TopControlsState current = TOP_CONTROLS_STATE_BOTH; | 46 TopControlsState current = TOP_CONTROLS_STATE_BOTH; |
| 47 | 47 |
| 48 UpdateTopControlsState(constraints, current, animate); | 48 UpdateTopControlsState(constraints, current, animate); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void RenderViewImpl::UpdateTopControlsState(TopControlsState constraints, | 51 void RenderViewImpl::UpdateTopControlsState(TopControlsState constraints, |
| 52 TopControlsState current, | 52 TopControlsState current, |
| 53 bool animate) { | 53 bool animate) { |
| 54 if (webwidget()) | 54 if (GetWebWidget()) |
| 55 webwidget()->updateTopControlsState(ContentToBlink(constraints), | 55 GetWebWidget()->updateTopControlsState(ContentToBlink(constraints), |
| 56 ContentToBlink(current), | 56 ContentToBlink(current), animate); |
| 57 animate); | |
| 58 | 57 |
| 59 top_controls_constraints_ = constraints; | 58 top_controls_constraints_ = constraints; |
| 60 } | 59 } |
| 61 | 60 |
| 62 void RenderViewImpl::didScrollWithKeyboard(const blink::WebSize& delta) { | 61 void RenderViewImpl::didScrollWithKeyboard(const blink::WebSize& delta) { |
| 63 if (delta.height == 0) | 62 if (delta.height == 0) |
| 64 return; | 63 return; |
| 65 | 64 |
| 66 TopControlsState current = delta.height < 0 ? TOP_CONTROLS_STATE_SHOWN | 65 TopControlsState current = delta.height < 0 ? TOP_CONTROLS_STATE_SHOWN |
| 67 : TOP_CONTROLS_STATE_HIDDEN; | 66 : TOP_CONTROLS_STATE_HIDDEN; |
| 68 | 67 |
| 69 UpdateTopControlsState(top_controls_constraints_, current, true); | 68 UpdateTopControlsState(top_controls_constraints_, current, true); |
| 70 } | 69 } |
| 71 | 70 |
| 72 void RenderViewImpl::OnExtractSmartClipData(const gfx::Rect& rect) { | 71 void RenderViewImpl::OnExtractSmartClipData(const gfx::Rect& rect) { |
| 73 blink::WebString clip_text; | 72 blink::WebString clip_text; |
| 74 blink::WebString clip_html; | 73 blink::WebString clip_html; |
| 75 blink::WebRect clip_rect; | 74 blink::WebRect clip_rect; |
| 76 webview()->extractSmartClipData(rect, clip_text, clip_html, clip_rect); | 75 webview()->extractSmartClipData(rect, clip_text, clip_html, clip_rect); |
| 77 Send(new ViewHostMsg_SmartClipDataExtracted( | 76 Send(new ViewHostMsg_SmartClipDataExtracted( |
| 78 routing_id_, clip_text, clip_html, clip_rect)); | 77 routing_id_, clip_text, clip_html, clip_rect)); |
| 79 } | 78 } |
| 80 | 79 |
| 81 } // namespace content | 80 } // namespace content |
| OLD | NEW |