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

Unified Diff: chrome/browser/tab_contents/web_drag_source.h

Issue 159040: Fix another d&d crash that happens when the tab contents (Closed)
Patch Set: revise comment Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/tab_contents/web_drag_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/web_drag_source.h
diff --git a/chrome/browser/tab_contents/web_drag_source.h b/chrome/browser/tab_contents/web_drag_source.h
index d1cd6e06b8a21e197dc3b0cc9ffd94b33f39761f..f80c6c6859e64c3c131250b10fb30a8647a936c2 100644
--- a/chrome/browser/tab_contents/web_drag_source.h
+++ b/chrome/browser/tab_contents/web_drag_source.h
@@ -8,6 +8,8 @@
#include "base/basictypes.h"
#include "base/gfx/native_widget_types.h"
#include "base/gfx/point.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
// TODO(port): Port this file.
#if defined(OS_WIN)
@@ -17,6 +19,7 @@
#endif
class RenderViewHost;
+class TabContents;
///////////////////////////////////////////////////////////////////////////////
//
@@ -27,12 +30,18 @@ class RenderViewHost;
// on their system. This object tells Windows whether or not the drag should
// continue, and supplies the appropriate cursors.
//
-class WebDragSource : public BaseDragSource {
+class WebDragSource : public BaseDragSource,
+ public NotificationObserver {
public:
- // Create a new DragSource for a given HWND and RenderViewHost.
- WebDragSource(gfx::NativeWindow source_wnd, RenderViewHost* render_view_host);
+ // Create a new DragSource for a given HWND and TabContents.
+ WebDragSource(gfx::NativeWindow source_wnd, TabContents* tab_contents);
virtual ~WebDragSource() { }
+ // NotificationObserver implementation.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
protected:
// BaseDragSource
virtual void OnDragSourceCancel();
@@ -51,6 +60,8 @@ class WebDragSource : public BaseDragSource {
// initiated terminates).
RenderViewHost* render_view_host_;
+ NotificationRegistrar registrar_;
+
DISALLOW_COPY_AND_ASSIGN(WebDragSource);
};
« no previous file with comments | « no previous file | chrome/browser/tab_contents/web_drag_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698