| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BOOKMARK_HANDLER_GTK_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_GTK_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_GTK_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_GTK_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 9 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
| 10 #include "content/public/browser/web_drag_dest_delegate.h" | 10 #include "content/public/browser/web_drag_dest_delegate.h" |
| 11 | 11 |
| 12 class TabContents; | 12 class BookmarkTabHelper; |
| 13 |
| 14 namespace content { |
| 15 class WebContents; |
| 16 } |
| 13 | 17 |
| 14 // Chrome needs to intercept content drag events so it can dispatch them to the | 18 // Chrome needs to intercept content drag events so it can dispatch them to the |
| 15 // bookmarks and extensions system. | 19 // bookmarks and extensions system. |
| 16 class WebDragBookmarkHandlerGtk : public content::WebDragDestDelegate { | 20 class WebDragBookmarkHandlerGtk : public content::WebDragDestDelegate { |
| 17 public: | 21 public: |
| 18 WebDragBookmarkHandlerGtk(); | 22 WebDragBookmarkHandlerGtk(); |
| 19 virtual ~WebDragBookmarkHandlerGtk(); | 23 virtual ~WebDragBookmarkHandlerGtk(); |
| 20 | 24 |
| 21 // Overridden from content::WebDragDestDelegate: | 25 // Overridden from content::WebDragDestDelegate: |
| 22 virtual void DragInitialize(content::WebContents* contents) OVERRIDE; | 26 virtual void DragInitialize(content::WebContents* contents) OVERRIDE; |
| 23 virtual GdkAtom GetBookmarkTargetAtom() const OVERRIDE; | 27 virtual GdkAtom GetBookmarkTargetAtom() const OVERRIDE; |
| 24 virtual void OnReceiveDataFromGtk(GtkSelectionData* data) OVERRIDE; | 28 virtual void OnReceiveDataFromGtk(GtkSelectionData* data) OVERRIDE; |
| 25 virtual void OnReceiveProcessedData(const GURL& url, | 29 virtual void OnReceiveProcessedData(const GURL& url, |
| 26 const string16& title) OVERRIDE; | 30 const string16& title) OVERRIDE; |
| 27 virtual void OnDragOver() OVERRIDE; | 31 virtual void OnDragOver() OVERRIDE; |
| 28 virtual void OnDragEnter() OVERRIDE; | 32 virtual void OnDragEnter() OVERRIDE; |
| 29 virtual void OnDrop() OVERRIDE; | 33 virtual void OnDrop() OVERRIDE; |
| 30 virtual void OnDragLeave() OVERRIDE; | 34 virtual void OnDragLeave() OVERRIDE; |
| 31 | 35 |
| 32 private: | 36 private: |
| 33 // The TabContents. | 37 // The BookmarkTabHelper. |
| 34 // Weak reference; may be NULL if the contents aren't contained in a | 38 // Weak reference; may be NULL if the contents don't have a |
| 35 // TabContents (e.g. WebUI dialogs). | 39 // BookmarkTabHelper (e.g. WebUI dialogs). |
| 36 TabContents* tab_; | 40 BookmarkTabHelper* bookmark_tab_helper_; |
| 41 |
| 42 content::WebContents* web_contents_; |
| 37 | 43 |
| 38 // The bookmark data for the current tab. This will be empty if there is not | 44 // The bookmark data for the current tab. This will be empty if there is not |
| 39 // a native bookmark drag (or we haven't gotten the data from the source yet). | 45 // a native bookmark drag (or we haven't gotten the data from the source yet). |
| 40 BookmarkNodeData bookmark_drag_data_; | 46 BookmarkNodeData bookmark_drag_data_; |
| 41 | 47 |
| 42 DISALLOW_COPY_AND_ASSIGN(WebDragBookmarkHandlerGtk); | 48 DISALLOW_COPY_AND_ASSIGN(WebDragBookmarkHandlerGtk); |
| 43 }; | 49 }; |
| 44 | 50 |
| 45 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_GTK_H_ | 51 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_GTK_H_ |
| OLD | NEW |