Home | History | Annotate | Download | only in tab_contents
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_AURA_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_
      6 #define CHROME_BROWSER_UI_AURA_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_
      7 
      8 #include "content/public/browser/web_contents.h"
      9 #include "content/public/browser/web_drag_dest_delegate.h"
     10 #include "chrome/browser/bookmarks/bookmark_node_data.h"
     11 
     12 class BookmarkTabHelper;
     13 
     14 namespace content {
     15 class WebContents;
     16 }
     17 
     18 // Chrome needs to intercept content drag events so it can dispatch them to the
     19 // bookmarks and extensions system.
     20 // Note that unlike the other platforms, Aura doesn't use all of the
     21 // WebDragDest infrastructure, just the WebDragDestDelegate.
     22 class WebDragBookmarkHandlerAura : public content::WebDragDestDelegate {
     23  public:
     24   WebDragBookmarkHandlerAura();
     25   virtual ~WebDragBookmarkHandlerAura();
     26 
     27   // Overridden from content::WebDragDestDelegate:
     28   virtual void DragInitialize(content::WebContents* contents) OVERRIDE;
     29   virtual void OnDragOver() OVERRIDE;
     30   virtual void OnDragEnter() OVERRIDE;
     31   virtual void OnDrop() OVERRIDE;
     32   virtual void OnDragLeave() OVERRIDE;
     33 
     34   virtual void OnReceiveDragData(const ui::OSExchangeData& data) OVERRIDE;
     35 
     36  private:
     37   // The BookmarkTabHelper.
     38   // Weak reference; may be NULL if the contents don't have a
     39   // BookmarkTabHelper (e.g. WebUI dialogs).
     40   BookmarkTabHelper* bookmark_tab_helper_;
     41 
     42   content::WebContents* web_contents_;
     43 
     44   // The bookmark data for the active drag.  Empty when there is no active drag.
     45   BookmarkNodeData bookmark_drag_data_;
     46 
     47   DISALLOW_COPY_AND_ASSIGN(WebDragBookmarkHandlerAura);
     48 };
     49 
     50 #endif  // CHROME_BROWSER_UI_AURA_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_
     51