Home | History | Annotate | Download | only in browser
      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 CONTENT_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_
      6 #define CONTENT_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_
      7 
      8 #include "base/strings/string16.h"
      9 
     10 class GURL;
     11 
     12 namespace ui {
     13 class OSExchangeData;
     14 }
     15 
     16 namespace content {
     17 class WebContents;
     18 struct DropData;
     19 
     20 // An optional delegate that listens for drags of bookmark data.
     21 class WebDragDestDelegate {
     22  public:
     23   // Announces that a drag has started. It's valid that a drag starts, along
     24   // with over/enter/leave/drop notifications without receiving any bookmark
     25   // data.
     26   virtual void DragInitialize(WebContents* contents) = 0;
     27 
     28   // Notifications of drag progression.
     29   virtual void OnDragOver() = 0;
     30   virtual void OnDragEnter() = 0;
     31   virtual void OnDrop() = 0;
     32   // This should also clear any state kept about this drag.
     33   virtual void OnDragLeave() = 0;
     34 
     35 #if defined(USE_AURA)
     36   // Called at the start of every drag to supply the data associated with the
     37   // drag.
     38   virtual void OnReceiveDragData(const ui::OSExchangeData& data) = 0;
     39 #endif  // USE_AURA
     40 
     41   virtual ~WebDragDestDelegate() {}
     42 };
     43 
     44 }  // namespace content
     45 
     46 #endif  // CONTENT_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_
     47