Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Side by Side Diff: chrome/browser/tab_contents/web_drag_source_win.h

Issue 3822007: Move BaseDropTarget and BaseDragSource from base to app/win. Remove the "Base... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/base_drag_source.h" 9 #include "app/win/drag_source.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "chrome/common/notification_observer.h" 11 #include "chrome/common/notification_observer.h"
12 #include "chrome/common/notification_registrar.h" 12 #include "chrome/common/notification_registrar.h"
13 #include "gfx/native_widget_types.h" 13 #include "gfx/native_widget_types.h"
14 #include "gfx/point.h" 14 #include "gfx/point.h"
15 15
16 class RenderViewHost; 16 class RenderViewHost;
17 class TabContents; 17 class TabContents;
18 18
19 /////////////////////////////////////////////////////////////////////////////// 19 // An IDropSource implementation for a TabContents. Handles notifications sent
20 // 20 // by an active drag-drop operation as the user mouses over other drop targets
21 // WebDragSource 21 // on their system. This object tells Windows whether or not the drag should
22 // 22 // continue, and supplies the appropriate cursors.
23 // An IDropSource implementation for a TabContents. Handles notifications sent 23 class WebDragSource : public app::win::DragSource,
24 // by an active drag-drop operation as the user mouses over other drop targets
25 // on their system. This object tells Windows whether or not the drag should
26 // continue, and supplies the appropriate cursors.
27 //
28 class WebDragSource : public BaseDragSource,
29 public NotificationObserver { 24 public NotificationObserver {
30 public: 25 public:
31 // Create a new DragSource for a given HWND and TabContents. 26 // Create a new DragSource for a given HWND and TabContents.
32 WebDragSource(gfx::NativeWindow source_wnd, TabContents* tab_contents); 27 WebDragSource(gfx::NativeWindow source_wnd, TabContents* tab_contents);
33 virtual ~WebDragSource() { } 28 virtual ~WebDragSource();
34 29
35 // NotificationObserver implementation. 30 // NotificationObserver implementation.
36 virtual void Observe(NotificationType type, 31 virtual void Observe(NotificationType type,
37 const NotificationSource& source, 32 const NotificationSource& source,
38 const NotificationDetails& details); 33 const NotificationDetails& details);
39 34
40 void set_effect(DWORD effect) { effect_ = effect; } 35 void set_effect(DWORD effect) { effect_ = effect; }
41 36
42 protected: 37 protected:
43 // BaseDragSource 38 // app::win::DragSource
44 virtual void OnDragSourceCancel(); 39 virtual void OnDragSourceCancel();
45 virtual void OnDragSourceDrop(); 40 virtual void OnDragSourceDrop();
46 virtual void OnDragSourceMove(); 41 virtual void OnDragSourceMove();
47 42
48 private: 43 private:
49 // Cannot construct thusly. 44 // Cannot construct thusly.
50 WebDragSource(); 45 WebDragSource();
51 46
52 // OnDragSourceDrop schedules its main work to be done after IDropTarget::Drop 47 // OnDragSourceDrop schedules its main work to be done after IDropTarget::Drop
53 // by posting a task to this function. 48 // by posting a task to this function.
54 void DelayedOnDragSourceDrop(); 49 void DelayedOnDragSourceDrop();
55 50
56 // Keep a reference to the window so we can translate the cursor position. 51 // Keep a reference to the window so we can translate the cursor position.
57 gfx::NativeWindow source_wnd_; 52 gfx::NativeWindow source_wnd_;
58 53
59 // We use this as a channel to the renderer to tell it about various drag 54 // We use this as a channel to the renderer to tell it about various drag
60 // drop events that it needs to know about (such as when a drag operation it 55 // drop events that it needs to know about (such as when a drag operation it
61 // initiated terminates). 56 // initiated terminates).
62 RenderViewHost* render_view_host_; 57 RenderViewHost* render_view_host_;
63 58
64 NotificationRegistrar registrar_; 59 NotificationRegistrar registrar_;
65 60
66 DWORD effect_; 61 DWORD effect_;
67 62
68 DISALLOW_COPY_AND_ASSIGN(WebDragSource); 63 DISALLOW_COPY_AND_ASSIGN(WebDragSource);
69 }; 64 };
70 65
71 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ 66 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_util.cc ('k') | chrome/browser/tab_contents/web_drag_source_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698