Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: content/browser/web_contents/web_drag_dest_mac.h

Issue 10386014: Implement WebContentsView::GetDropData for Mac; disable on Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert more aura changes. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/memory/scoped_ptr.h"
7 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "webkit/glue/webdropdata.h"
8 10
9 class WebContentsImpl; 11 class WebContentsImpl;
10 struct WebDropData;
11 12
12 namespace content { 13 namespace content {
13 class RenderViewHost; 14 class RenderViewHost;
14 class WebDragDestDelegate; 15 class WebDragDestDelegate;
15 } 16 }
16 17
17 // A typedef for a RenderViewHost used for comparison purposes only. 18 // A typedef for a RenderViewHost used for comparison purposes only.
18 typedef content::RenderViewHost* RenderViewHostIdentifier; 19 typedef content::RenderViewHost* RenderViewHostIdentifier;
19 20
20 // A class that handles tracking and event processing for a drag and drop 21 // A class that handles tracking and event processing for a drag and drop
21 // over the content area. Assumes something else initiates the drag, this is 22 // over the content area. Assumes something else initiates the drag, this is
22 // only for processing during a drag. 23 // only for processing during a drag.
23 24
24 @interface WebDragDest : NSObject { 25 @interface WebDragDest : NSObject {
25 @private 26 @private
26 // Our associated WebContentsImpl. Weak reference. 27 // Our associated WebContentsImpl. Weak reference.
27 WebContentsImpl* webContents_; 28 WebContentsImpl* webContents_;
28 29
29 // Delegate; weak. 30 // Delegate; weak.
30 content::WebDragDestDelegate* delegate_; 31 content::WebDragDestDelegate* delegate_;
31 32
32 // Updated asynchronously during a drag to tell us whether or not we should 33 // Updated asynchronously during a drag to tell us whether or not we should
33 // allow the drop. 34 // allow the drop.
34 NSDragOperation current_operation_; 35 NSDragOperation currentOperation_;
35 36
36 // Keep track of the render view host we're dragging over. If it changes 37 // Keep track of the render view host we're dragging over. If it changes
37 // during a drag, we need to re-send the DragEnter message. 38 // during a drag, we need to re-send the DragEnter message.
38 RenderViewHostIdentifier currentRVH_; 39 RenderViewHostIdentifier currentRVH_;
40
41 // The data for the current drag, or NULL if none is in progress.
42 scoped_ptr<WebDropData> dropData_;
39 } 43 }
40 44
41 // |contents| is the WebContentsImpl representing this tab, used to communicate 45 // |contents| is the WebContentsImpl representing this tab, used to communicate
42 // drag&drop messages to WebCore and handle navigation on a successful drop 46 // drag&drop messages to WebCore and handle navigation on a successful drop
43 // (if necessary). 47 // (if necessary).
44 - (id)initWithWebContentsImpl:(WebContentsImpl*)contents; 48 - (id)initWithWebContentsImpl:(WebContentsImpl*)contents;
45 49
50 - (WebDropData*)currentDropData;
51
46 - (void)setDragDelegate:(content::WebDragDestDelegate*)delegate; 52 - (void)setDragDelegate:(content::WebDragDestDelegate*)delegate;
47 53
48 // Sets the current operation negotiated by the source and destination, 54 // Sets the current operation negotiated by the source and destination,
49 // which determines whether or not we should allow the drop. Takes effect the 55 // which determines whether or not we should allow the drop. Takes effect the
50 // next time |-draggingUpdated:| is called. 56 // next time |-draggingUpdated:| is called.
51 - (void)setCurrentOperation:(NSDragOperation)operation; 57 - (void)setCurrentOperation:(NSDragOperation)operation;
52 58
53 // Messages to send during the tracking of a drag, ususally upon receiving 59 // Messages to send during the tracking of a drag, ususally upon receiving
54 // calls from the view system. Communicates the drag messages to WebCore. 60 // calls from the view system. Communicates the drag messages to WebCore.
55 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)info 61 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)info
(...skipping 14 matching lines...) Expand all
70 fromPasteboard:(NSPasteboard*)pboard; 76 fromPasteboard:(NSPasteboard*)pboard;
71 // Given a point in window coordinates and a view in that window, return a 77 // Given a point in window coordinates and a view in that window, return a
72 // flipped point in the coordinate system of |view|. 78 // flipped point in the coordinate system of |view|.
73 - (NSPoint)flipWindowPointToView:(const NSPoint&)windowPoint 79 - (NSPoint)flipWindowPointToView:(const NSPoint&)windowPoint
74 view:(NSView*)view; 80 view:(NSView*)view;
75 // Given a point in window coordinates and a view in that window, return a 81 // Given a point in window coordinates and a view in that window, return a
76 // flipped point in screen coordinates. 82 // flipped point in screen coordinates.
77 - (NSPoint)flipWindowPointToScreen:(const NSPoint&)windowPoint 83 - (NSPoint)flipWindowPointToScreen:(const NSPoint&)windowPoint
78 view:(NSView*)view; 84 view:(NSView*)view;
79 @end 85 @end
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_drag_dest_gtk.cc ('k') | content/browser/web_contents/web_drag_dest_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698