| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_VIEWS_ROOT_VIEW_DROP_TARGET_H__ | 5 #ifndef CHROME_VIEWS_ROOT_VIEW_DROP_TARGET_H__ |
| 6 #define CHROME_VIEWS_ROOT_VIEW_DROP_TARGET_H__ | 6 #define CHROME_VIEWS_ROOT_VIEW_DROP_TARGET_H__ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlapp.h> | 9 #include <atlapp.h> |
| 10 #include <atlmisc.h> | 10 #include <atlmisc.h> |
| 11 | 11 |
| 12 #include "base/base_drop_target.h" | 12 #include "base/base_drop_target.h" |
| 13 #include "chrome/common/os_exchange_data.h" | 13 #include "chrome/common/os_exchange_data.h" |
| 14 | 14 |
| 15 namespace gfx { |
| 16 class Point; |
| 17 } |
| 18 |
| 15 namespace ChromeViews { | 19 namespace ChromeViews { |
| 16 | 20 |
| 17 class RootView; | 21 class RootView; |
| 18 class View; | 22 class View; |
| 19 | 23 |
| 20 // RootViewDropTarget takes care of managing drag and drop for the RootView and | 24 // RootViewDropTarget takes care of managing drag and drop for the RootView and |
| 21 // converts Windows OLE drop messages into Views drop messages. | 25 // converts Windows OLE drop messages into Views drop messages. |
| 22 // | 26 // |
| 23 // RootViewDropTarget is responsible for determining the appropriate View to | 27 // RootViewDropTarget is responsible for determining the appropriate View to |
| 24 // use during a drag and drop session, and forwarding events to it. | 28 // use during a drag and drop session, and forwarding events to it. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 44 virtual DWORD OnDrop(IDataObject* data_object, | 48 virtual DWORD OnDrop(IDataObject* data_object, |
| 45 DWORD key_state, | 49 DWORD key_state, |
| 46 POINT cursor_position, | 50 POINT cursor_position, |
| 47 DWORD effect); | 51 DWORD effect); |
| 48 | 52 |
| 49 private: | 53 private: |
| 50 // Calculates the target view for a drop given the specified location in | 54 // Calculates the target view for a drop given the specified location in |
| 51 // the coordinate system of the rootview. This tries to avoid continually | 55 // the coordinate system of the rootview. This tries to avoid continually |
| 52 // querying CanDrop by returning target_view_ if the mouse is still over | 56 // querying CanDrop by returning target_view_ if the mouse is still over |
| 53 // target_view_. | 57 // target_view_. |
| 54 View* CalculateTargetView(const CPoint& root_view_location, | 58 View* CalculateTargetView(const gfx::Point& root_view_location, |
| 55 const OSExchangeData& data); | 59 const OSExchangeData& data); |
| 56 | 60 |
| 57 // RootView we were created for. | 61 // RootView we were created for. |
| 58 RootView* root_view_; | 62 RootView* root_view_; |
| 59 | 63 |
| 60 // View we're targeting events at. | 64 // View we're targeting events at. |
| 61 View* target_view_; | 65 View* target_view_; |
| 62 | 66 |
| 63 // The deepest view under the current drop coordinate. | 67 // The deepest view under the current drop coordinate. |
| 64 View* deepest_view_; | 68 View* deepest_view_; |
| 65 | 69 |
| 66 DISALLOW_EVIL_CONSTRUCTORS(RootViewDropTarget); | 70 DISALLOW_EVIL_CONSTRUCTORS(RootViewDropTarget); |
| 67 }; | 71 }; |
| 68 | 72 |
| 69 } // namespace | 73 } // namespace |
| 70 | 74 |
| 71 #endif // CHROME_VIEWS_ROOT_VIEW_DROP_TARGET_H__ | 75 #endif // CHROME_VIEWS_ROOT_VIEW_DROP_TARGET_H__ |
| 72 | 76 |
| OLD | NEW |