OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/widget/root_view.h" | 5 #include "views/widget/root_view.h" |
6 | 6 |
7 #include "app/drag_drop_types.h" | |
8 #include "app/win/drag_source.h" | |
9 #include "gfx/canvas_skia.h" | 7 #include "gfx/canvas_skia.h" |
| 8 #include "ui/base/dragdrop/drag_drop_types.h" |
| 9 #include "ui/base/dragdrop/drag_source.h" |
10 #include "ui/base/dragdrop/os_exchange_data.h" | 10 #include "ui/base/dragdrop/os_exchange_data.h" |
11 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" | 11 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
12 | 12 |
13 using ui::OSExchangeData; | 13 using ui::OSExchangeData; |
14 using ui::OSExchangeDataProviderWin; | 14 using ui::OSExchangeDataProviderWin; |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 | 17 |
18 void RootView::OnPaint(HWND hwnd) { | 18 void RootView::OnPaint(HWND hwnd) { |
19 gfx::Rect original_dirty_region = GetScheduledPaintRectConstrainedToSize(); | 19 gfx::Rect original_dirty_region = GetScheduledPaintRectConstrainedToSize(); |
(...skipping 14 matching lines...) Expand all Loading... |
34 ProcessPaint(canvas->AsCanvas()); | 34 ProcessPaint(canvas->AsCanvas()); |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 void RootView::StartDragForViewFromMouseEvent( | 38 void RootView::StartDragForViewFromMouseEvent( |
39 View* view, | 39 View* view, |
40 const OSExchangeData& data, | 40 const OSExchangeData& data, |
41 int operation) { | 41 int operation) { |
42 // NOTE: view may be null. | 42 // NOTE: view may be null. |
43 drag_view_ = view; | 43 drag_view_ = view; |
44 scoped_refptr<app::win::DragSource> drag_source(new app::win::DragSource); | 44 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); |
45 DWORD effects; | 45 DWORD effects; |
46 DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source, | 46 DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source, |
47 DragDropTypes::DragOperationToDropEffect(operation), &effects); | 47 ui::DragDropTypes::DragOperationToDropEffect(operation), &effects); |
48 // If the view is removed during the drag operation, drag_view_ is set to | 48 // If the view is removed during the drag operation, drag_view_ is set to |
49 // NULL. | 49 // NULL. |
50 if (view && drag_view_ == view) { | 50 if (view && drag_view_ == view) { |
51 View* drag_view = drag_view_; | 51 View* drag_view = drag_view_; |
52 drag_view_ = NULL; | 52 drag_view_ = NULL; |
53 drag_view->OnDragDone(); | 53 drag_view->OnDragDone(); |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 } | 57 } |
OLD | NEW |