| 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_AURA_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_ |
| 7 | 7 |
| 8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
| 9 #include "content/public/browser/web_drag_dest_delegate.h" | 9 #include "content/public/browser/web_drag_dest_delegate.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 10 #include "chrome/browser/bookmarks/bookmark_node_data.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 // Note that unlike the other platforms, Aura doesn't use all of the | 20 // Note that unlike the other platforms, Aura doesn't use all of the |
| 17 // WebDragDest infrastructure, just the WebDragDestDelegate. | 21 // WebDragDest infrastructure, just the WebDragDestDelegate. |
| 18 class WebDragBookmarkHandlerAura : public content::WebDragDestDelegate { | 22 class WebDragBookmarkHandlerAura : public content::WebDragDestDelegate { |
| 19 public: | 23 public: |
| 20 WebDragBookmarkHandlerAura(); | 24 WebDragBookmarkHandlerAura(); |
| 21 virtual ~WebDragBookmarkHandlerAura(); | 25 virtual ~WebDragBookmarkHandlerAura(); |
| 22 | 26 |
| 23 // Overridden from content::WebDragDestDelegate: | 27 // Overridden from content::WebDragDestDelegate: |
| 24 virtual void DragInitialize(content::WebContents* contents) OVERRIDE; | 28 virtual void DragInitialize(content::WebContents* contents) OVERRIDE; |
| 25 virtual void OnDragOver() OVERRIDE; | 29 virtual void OnDragOver() OVERRIDE; |
| 26 virtual void OnDragEnter() OVERRIDE; | 30 virtual void OnDragEnter() OVERRIDE; |
| 27 virtual void OnDrop() OVERRIDE; | 31 virtual void OnDrop() OVERRIDE; |
| 28 virtual void OnDragLeave() OVERRIDE; | 32 virtual void OnDragLeave() OVERRIDE; |
| 29 | 33 |
| 30 virtual void OnReceiveDragData(const ui::OSExchangeData& data) OVERRIDE; | 34 virtual void OnReceiveDragData(const ui::OSExchangeData& data) 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 active drag. Empty when there is no active drag. | 44 // The bookmark data for the active drag. Empty when there is no active drag. |
| 39 BookmarkNodeData bookmark_drag_data_; | 45 BookmarkNodeData bookmark_drag_data_; |
| 40 | 46 |
| 41 DISALLOW_COPY_AND_ASSIGN(WebDragBookmarkHandlerAura); | 47 DISALLOW_COPY_AND_ASSIGN(WebDragBookmarkHandlerAura); |
| 42 }; | 48 }; |
| 43 | 49 |
| 44 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_ | 50 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_ |
| OLD | NEW |