| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "content/public/browser/web_drag_dest_delegate.h" | 10 #include "content/public/browser/web_drag_dest_delegate.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 11 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
| 12 | 12 |
| 13 class TabContents; | 13 class TabContents; |
| 14 typedef TabContents TabContentsWrapper; | |
| 15 | 14 |
| 16 // Chrome needs to intercept content drag events so it can dispatch them to the | 15 // Chrome needs to intercept content drag events so it can dispatch them to the |
| 17 // bookmarks and extensions system. | 16 // bookmarks and extensions system. |
| 18 // Note that unlike the other platforms, Aura doesn't use all of the | 17 // Note that unlike the other platforms, Aura doesn't use all of the |
| 19 // WebDragDest infrastructure, just the WebDragDestDelegate. | 18 // WebDragDest infrastructure, just the WebDragDestDelegate. |
| 20 class WebDragBookmarkHandlerAura : public content::WebDragDestDelegate { | 19 class WebDragBookmarkHandlerAura : public content::WebDragDestDelegate { |
| 21 public: | 20 public: |
| 22 WebDragBookmarkHandlerAura(); | 21 WebDragBookmarkHandlerAura(); |
| 23 virtual ~WebDragBookmarkHandlerAura(); | 22 virtual ~WebDragBookmarkHandlerAura(); |
| 24 | 23 |
| 25 // Overridden from content::WebDragDestDelegate: | 24 // Overridden from content::WebDragDestDelegate: |
| 26 virtual void DragInitialize(content::WebContents* contents) OVERRIDE; | 25 virtual void DragInitialize(content::WebContents* contents) OVERRIDE; |
| 27 virtual void OnDragOver() OVERRIDE; | 26 virtual void OnDragOver() OVERRIDE; |
| 28 virtual void OnDragEnter() OVERRIDE; | 27 virtual void OnDragEnter() OVERRIDE; |
| 29 virtual void OnDrop() OVERRIDE; | 28 virtual void OnDrop() OVERRIDE; |
| 30 virtual void OnDragLeave() OVERRIDE; | 29 virtual void OnDragLeave() OVERRIDE; |
| 31 | 30 |
| 32 virtual void OnReceiveDragData(const ui::OSExchangeData& data) OVERRIDE; | 31 virtual void OnReceiveDragData(const ui::OSExchangeData& data) OVERRIDE; |
| 33 | 32 |
| 34 private: | 33 private: |
| 35 // The TabContentsWrapper for the drag. | 34 // The TabContents. |
| 36 // Weak reference; may be NULL if the contents aren't contained in a wrapper | 35 // Weak reference; may be NULL if the contents aren't contained in a |
| 37 // (e.g. WebUI dialogs). | 36 // TabContents (e.g. WebUI dialogs). |
| 38 TabContentsWrapper* tab_; | 37 TabContents* tab_; |
| 39 | 38 |
| 40 // The bookmark data for the active drag. Empty when there is no active drag. | 39 // The bookmark data for the active drag. Empty when there is no active drag. |
| 41 BookmarkNodeData bookmark_drag_data_; | 40 BookmarkNodeData bookmark_drag_data_; |
| 42 | 41 |
| 43 DISALLOW_COPY_AND_ASSIGN(WebDragBookmarkHandlerAura); | 42 DISALLOW_COPY_AND_ASSIGN(WebDragBookmarkHandlerAura); |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_ | 45 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_ |
| OLD | NEW |