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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 bool HandleMouseLockedInputEvent(const blink::WebMouseEvent& event) override { | 419 bool HandleMouseLockedInputEvent(const blink::WebMouseEvent& event) override { |
420 // The WebWidget handles mouse lock in WebKit's handleInputEvent(). | 420 // The WebWidget handles mouse lock in WebKit's handleInputEvent(). |
421 return false; | 421 return false; |
422 } | 422 } |
423 | 423 |
424 private: | 424 private: |
425 blink::WebWidget* webwidget_; | 425 blink::WebWidget* webwidget_; |
426 }; | 426 }; |
427 | 427 |
428 WebDragData DropDataToWebDragData(const DropData& drop_data) { | 428 WebDragData DropDataToWebDragData(const DropData& drop_data) { |
| 429 if (!drop_data.is_valid) |
| 430 return WebDragData(); |
| 431 |
429 std::vector<WebDragData::Item> item_list; | 432 std::vector<WebDragData::Item> item_list; |
430 | 433 |
431 // These fields are currently unused when dragging into WebKit. | 434 // These fields are currently unused when dragging into WebKit. |
432 DCHECK(drop_data.download_metadata.empty()); | 435 DCHECK(drop_data.download_metadata.empty()); |
433 DCHECK(drop_data.file_contents.empty()); | 436 DCHECK(drop_data.file_contents.empty()); |
434 DCHECK(drop_data.file_description_filename.empty()); | 437 DCHECK(drop_data.file_description_filename.empty()); |
435 | 438 |
436 if (!drop_data.text.is_null()) { | 439 if (!drop_data.text.is_null()) { |
437 WebDragData::Item item; | 440 WebDragData::Item item; |
438 item.storageType = WebDragData::Item::StorageTypeString; | 441 item.storageType = WebDragData::Item::StorageTypeString; |
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2431 ops, | 2434 ops, |
2432 key_modifiers); | 2435 key_modifiers); |
2433 | 2436 |
2434 Send(new DragHostMsg_UpdateDragCursor(routing_id(), operation)); | 2437 Send(new DragHostMsg_UpdateDragCursor(routing_id(), operation)); |
2435 } | 2438 } |
2436 | 2439 |
2437 void RenderViewImpl::OnDragTargetDragLeave() { | 2440 void RenderViewImpl::OnDragTargetDragLeave() { |
2438 webview()->dragTargetDragLeave(); | 2441 webview()->dragTargetDragLeave(); |
2439 } | 2442 } |
2440 | 2443 |
2441 void RenderViewImpl::OnDragTargetDrop(const gfx::Point& client_point, | 2444 void RenderViewImpl::OnDragTargetDrop(const DropData& drop_data, |
| 2445 const gfx::Point& client_point, |
2442 const gfx::Point& screen_point, | 2446 const gfx::Point& screen_point, |
2443 int key_modifiers) { | 2447 int key_modifiers) { |
2444 webview()->dragTargetDrop(client_point, screen_point, key_modifiers); | 2448 webview()->dragTargetDrop(DropDataToWebDragData(drop_data), client_point, |
| 2449 screen_point, key_modifiers); |
2445 } | 2450 } |
2446 | 2451 |
2447 void RenderViewImpl::OnDragSourceEnded(const gfx::Point& client_point, | 2452 void RenderViewImpl::OnDragSourceEnded(const gfx::Point& client_point, |
2448 const gfx::Point& screen_point, | 2453 const gfx::Point& screen_point, |
2449 WebDragOperation op) { | 2454 WebDragOperation op) { |
2450 webview()->dragSourceEndedAt(client_point, screen_point, op); | 2455 webview()->dragSourceEndedAt(client_point, screen_point, op); |
2451 } | 2456 } |
2452 | 2457 |
2453 void RenderViewImpl::OnDragSourceSystemDragEnded() { | 2458 void RenderViewImpl::OnDragSourceSystemDragEnded() { |
2454 webview()->dragSourceSystemDragEnded(); | 2459 webview()->dragSourceSystemDragEnded(); |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3537 if (IsUseZoomForDSFEnabled()) { | 3542 if (IsUseZoomForDSFEnabled()) { |
3538 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3543 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
3539 } else { | 3544 } else { |
3540 webview()->setDeviceScaleFactor(device_scale_factor_); | 3545 webview()->setDeviceScaleFactor(device_scale_factor_); |
3541 } | 3546 } |
3542 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3547 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
3543 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3548 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
3544 } | 3549 } |
3545 | 3550 |
3546 } // namespace content | 3551 } // namespace content |
OLD | NEW |