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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
23 #include "ui/base/clipboard/custom_data_helper.h" | 23 #include "ui/base/clipboard/custom_data_helper.h" |
24 #include "ui/base/dragdrop/drag_drop_types.h" | 24 #include "ui/base/dragdrop/drag_drop_types.h" |
25 #include "ui/base/dragdrop/os_exchange_data.h" | 25 #include "ui/base/dragdrop/os_exchange_data.h" |
26 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" | 26 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" |
27 #include "ui/base/hit_test.h" | 27 #include "ui/base/hit_test.h" |
28 #include "ui/compositor/layer.h" | 28 #include "ui/compositor/layer.h" |
29 #include "ui/gfx/screen.h" | 29 #include "ui/gfx/screen.h" |
30 #include "webkit/glue/webdropdata.h" | 30 #include "webkit/glue/webdropdata.h" |
31 | 31 |
| 32 namespace content { |
| 33 WebContentsView* CreateWebContentsView(WebContentsImpl* web_contents, |
| 34 WebContentsViewDelegate* delegate) { |
| 35 return new WebContentsViewAura(web_contents, delegate); |
| 36 } |
| 37 } |
| 38 |
32 namespace { | 39 namespace { |
33 | 40 |
34 // Listens to all mouse drag events during a drag and drop and sends them to | 41 // Listens to all mouse drag events during a drag and drop and sends them to |
35 // the renderer. | 42 // the renderer. |
36 class WebDragSourceAura : public MessageLoopForUI::Observer { | 43 class WebDragSourceAura : public MessageLoopForUI::Observer { |
37 public: | 44 public: |
38 explicit WebDragSourceAura(WebContentsImpl* contents) | 45 explicit WebDragSourceAura(WebContentsImpl* contents) |
39 : contents_(contents) { | 46 : contents_(contents) { |
40 MessageLoopForUI::current()->AddObserver(this); | 47 MessageLoopForUI::current()->AddObserver(this); |
41 } | 48 } |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 OnDragEntered(event); | 652 OnDragEntered(event); |
646 | 653 |
647 web_contents_->GetRenderViewHost()->DragTargetDrop( | 654 web_contents_->GetRenderViewHost()->DragTargetDrop( |
648 event.location(), | 655 event.location(), |
649 GetNativeView()->GetRootWindow()->last_mouse_location(), | 656 GetNativeView()->GetRootWindow()->last_mouse_location(), |
650 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 657 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
651 if (drag_dest_delegate_) | 658 if (drag_dest_delegate_) |
652 drag_dest_delegate_->OnDrop(); | 659 drag_dest_delegate_->OnDrop(); |
653 return current_drag_op_; | 660 return current_drag_op_; |
654 } | 661 } |
OLD | NEW |