| 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/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "content/browser/renderer_host/render_view_host_factory.h" | 8 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 9 #include "content/browser/web_contents/interstitial_page_impl.h" | 9 #include "content/browser/web_contents/interstitial_page_impl.h" |
| 10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
| 11 #include "content/public/browser/render_view_host.h" | 11 #include "content/public/browser/render_view_host.h" |
| 12 #include "content/public/browser/render_widget_host.h" | 12 #include "content/public/browser/render_widget_host.h" |
| 13 #include "content/public/browser/render_widget_host_view.h" | 13 #include "content/public/browser/render_widget_host_view.h" |
| 14 #include "content/public/browser/web_contents_delegate.h" | 14 #include "content/public/browser/web_contents_delegate.h" |
| 15 #include "content/public/browser/web_contents_view_delegate.h" | 15 #include "content/public/browser/web_contents_view_delegate.h" |
| 16 #include "content/public/browser/web_drag_dest_delegate.h" | 16 #include "content/public/browser/web_drag_dest_delegate.h" |
| 17 #include "ui/aura/client/drag_drop_client.h" | 17 #include "ui/aura/client/drag_drop_client.h" |
| 18 #include "ui/aura/client/drag_drop_delegate.h" | 18 #include "ui/aura/client/drag_drop_delegate.h" |
| 19 #include "ui/aura/event.h" | 19 #include "ui/aura/event.h" |
| 20 #include "ui/aura/root_window.h" | 20 #include "ui/aura/root_window.h" |
| 21 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 22 #include "ui/base/clipboard/custom_data_helper.h" | 22 #include "ui/base/clipboard/custom_data_helper.h" |
| 23 #include "ui/base/dragdrop/drag_drop_types.h" | 23 #include "ui/base/dragdrop/drag_drop_types.h" |
| 24 #include "ui/base/dragdrop/os_exchange_data.h" | 24 #include "ui/base/dragdrop/os_exchange_data.h" |
| 25 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" | 25 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" |
| 26 #include "ui/base/hit_test.h" | 26 #include "ui/base/hit_test.h" |
| 27 #include "ui/gfx/compositor/layer.h" | 27 #include "ui/compositor/layer.h" |
| 28 #include "ui/gfx/screen.h" | 28 #include "ui/gfx/screen.h" |
| 29 #include "webkit/glue/webdropdata.h" | 29 #include "webkit/glue/webdropdata.h" |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 // Listens to all mouse drag events during a drag and drop and sends them to | 33 // Listens to all mouse drag events during a drag and drop and sends them to |
| 34 // the renderer. | 34 // the renderer. |
| 35 class WebDragSourceAura : public MessageLoopForUI::Observer { | 35 class WebDragSourceAura : public MessageLoopForUI::Observer { |
| 36 public: | 36 public: |
| 37 explicit WebDragSourceAura(WebContentsImpl* contents) | 37 explicit WebDragSourceAura(WebContentsImpl* contents) |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 } | 596 } |
| 597 | 597 |
| 598 int WebContentsViewAura::OnPerformDrop(const aura::DropTargetEvent& event) { | 598 int WebContentsViewAura::OnPerformDrop(const aura::DropTargetEvent& event) { |
| 599 web_contents_->GetRenderViewHost()->DragTargetDrop( | 599 web_contents_->GetRenderViewHost()->DragTargetDrop( |
| 600 event.location(), | 600 event.location(), |
| 601 GetNativeView()->GetRootWindow()->last_mouse_location()); | 601 GetNativeView()->GetRootWindow()->last_mouse_location()); |
| 602 if (drag_dest_delegate_) | 602 if (drag_dest_delegate_) |
| 603 drag_dest_delegate_->OnDrop(); | 603 drag_dest_delegate_->OnDrop(); |
| 604 return current_drag_op_; | 604 return current_drag_op_; |
| 605 } | 605 } |
| OLD | NEW |