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