| 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_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/gfx/native_widget_types.h" |
| 10 #include "base/gfx/point.h" |
| 11 |
| 12 // TODO(port): Port this file. |
| 13 #if defined(OS_WIN) |
| 8 #include "base/base_drag_source.h" | 14 #include "base/base_drag_source.h" |
| 9 #include "base/basictypes.h" | 15 #else |
| 16 #include "chrome/common/temp_scaffolding_stubs.h" |
| 17 #endif |
| 10 | 18 |
| 11 class RenderViewHost; | 19 class RenderViewHost; |
| 12 | 20 |
| 13 /////////////////////////////////////////////////////////////////////////////// | 21 /////////////////////////////////////////////////////////////////////////////// |
| 14 // | 22 // |
| 15 // WebDragSource | 23 // WebDragSource |
| 16 // | 24 // |
| 17 // An IDropSource implementation for a WebContents. Handles notifications sent | 25 // An IDropSource implementation for a WebContents. Handles notifications sent |
| 18 // by an active drag-drop operation as the user mouses over other drop targets | 26 // by an active drag-drop operation as the user mouses over other drop targets |
| 19 // on their system. This object tells Windows whether or not the drag should | 27 // on their system. This object tells Windows whether or not the drag should |
| 20 // continue, and supplies the appropriate cursors. | 28 // continue, and supplies the appropriate cursors. |
| 21 // | 29 // |
| 22 class WebDragSource : public BaseDragSource { | 30 class WebDragSource : public BaseDragSource { |
| 23 public: | 31 public: |
| 24 // Create a new DragSource for a given HWND and RenderViewHost. | 32 // Create a new DragSource for a given HWND and RenderViewHost. |
| 25 WebDragSource(HWND source_hwnd, RenderViewHost* render_view_host); | 33 WebDragSource(gfx::NativeWindow source_wnd, RenderViewHost* render_view_host); |
| 26 virtual ~WebDragSource() { } | 34 virtual ~WebDragSource() { } |
| 27 | 35 |
| 28 protected: | 36 protected: |
| 29 // BaseDragSource | 37 // BaseDragSource |
| 30 virtual void OnDragSourceDrop(); | 38 virtual void OnDragSourceDrop(); |
| 31 virtual void OnDragSourceMove(); | 39 virtual void OnDragSourceMove(); |
| 32 | 40 |
| 33 private: | 41 private: |
| 34 // Cannot construct thusly. | 42 // Cannot construct thusly. |
| 35 WebDragSource(); | 43 WebDragSource(); |
| 36 | 44 |
| 37 // Keep a reference to the HWND so we can translate the cursor position. | 45 // Keep a reference to the window so we can translate the cursor position. |
| 38 HWND source_hwnd_; | 46 gfx::NativeWindow source_wnd_; |
| 39 | 47 |
| 40 // We use this as a channel to the renderer to tell it about various drag | 48 // We use this as a channel to the renderer to tell it about various drag |
| 41 // drop events that it needs to know about (such as when a drag operation it | 49 // drop events that it needs to know about (such as when a drag operation it |
| 42 // initiated terminates). | 50 // initiated terminates). |
| 43 RenderViewHost* render_view_host_; | 51 RenderViewHost* render_view_host_; |
| 44 | 52 |
| 45 DISALLOW_COPY_AND_ASSIGN(WebDragSource); | 53 DISALLOW_COPY_AND_ASSIGN(WebDragSource); |
| 46 }; | 54 }; |
| 47 | 55 |
| 48 #endif // #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_H_ | 56 #endif // #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_H_ |
| 49 | 57 |
| OLD | NEW |