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 <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1933 void RenderViewImpl::setKeyboardFocusURL(const WebURL& url) { | 1933 void RenderViewImpl::setKeyboardFocusURL(const WebURL& url) { |
1934 focus_url_ = GURL(url); | 1934 focus_url_ = GURL(url); |
1935 UpdateTargetURL(focus_url_, mouse_over_url_); | 1935 UpdateTargetURL(focus_url_, mouse_over_url_); |
1936 } | 1936 } |
1937 | 1937 |
1938 void RenderViewImpl::startDragging(WebLocalFrame* frame, | 1938 void RenderViewImpl::startDragging(WebLocalFrame* frame, |
1939 const WebDragData& data, | 1939 const WebDragData& data, |
1940 WebDragOperationsMask mask, | 1940 WebDragOperationsMask mask, |
1941 const WebImage& image, | 1941 const WebImage& image, |
1942 const WebPoint& webImageOffset) { | 1942 const WebPoint& webImageOffset) { |
| 1943 blink::WebRect offset_in_window(webImageOffset.x, webImageOffset.y, 0, 0); |
| 1944 convertViewportToWindow(&offset_in_window); |
1943 DropData drop_data(DropDataBuilder::Build(data)); | 1945 DropData drop_data(DropDataBuilder::Build(data)); |
1944 drop_data.referrer_policy = frame->document().referrerPolicy(); | 1946 drop_data.referrer_policy = frame->document().referrerPolicy(); |
1945 gfx::Vector2d imageOffset(webImageOffset.x, webImageOffset.y); | 1947 gfx::Vector2d imageOffset(offset_in_window.x, offset_in_window.y); |
1946 Send(new DragHostMsg_StartDragging(routing_id(), drop_data, mask, | 1948 Send(new DragHostMsg_StartDragging(routing_id(), drop_data, mask, |
1947 image.getSkBitmap(), imageOffset, | 1949 image.getSkBitmap(), imageOffset, |
1948 possible_drag_event_info_)); | 1950 possible_drag_event_info_)); |
1949 } | 1951 } |
1950 | 1952 |
1951 bool RenderViewImpl::acceptsLoadDrops() { | 1953 bool RenderViewImpl::acceptsLoadDrops() { |
1952 return renderer_preferences_.can_accept_load_drops; | 1954 return renderer_preferences_.can_accept_load_drops; |
1953 } | 1955 } |
1954 | 1956 |
1955 void RenderViewImpl::focusNext() { | 1957 void RenderViewImpl::focusNext() { |
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3495 if (IsUseZoomForDSFEnabled()) { | 3497 if (IsUseZoomForDSFEnabled()) { |
3496 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3498 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
3497 } else { | 3499 } else { |
3498 webview()->setDeviceScaleFactor(device_scale_factor_); | 3500 webview()->setDeviceScaleFactor(device_scale_factor_); |
3499 } | 3501 } |
3500 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3502 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
3501 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3503 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
3502 } | 3504 } |
3503 | 3505 |
3504 } // namespace content | 3506 } // namespace content |
OLD | NEW |