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

Side by Side Diff: chrome/browser/cocoa/web_drop_target.h

Issue 174364: Plumb the DragOperation through all the layers between the platform DnD code ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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
« no previous file with comments | « chrome/browser/cocoa/web_drag_source.mm ('k') | chrome/browser/cocoa/web_drop_target.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 class RenderViewHost; 7 class RenderViewHost;
8 class TabContents; 8 class TabContents;
9 class WebDropData; 9 class WebDropData;
10 10
11 // A typedef for a RenderViewHost used for comparison purposes only. 11 // A typedef for a RenderViewHost used for comparison purposes only.
12 typedef RenderViewHost* RenderViewHostIdentifier; 12 typedef RenderViewHost* RenderViewHostIdentifier;
13 13
14 // A class that handles tracking and event processing for a drag and drop 14 // A class that handles tracking and event processing for a drag and drop
15 // over the content area. Assumes something else initiates the drag, this is 15 // over the content area. Assumes something else initiates the drag, this is
16 // only for processing during a drag. 16 // only for processing during a drag.
17 17
18 @interface WebDropTarget : NSObject { 18 @interface WebDropTarget : NSObject {
19 @private 19 @private
20 // Our associated TabContents. Weak reference. 20 // Our associated TabContents. Weak reference.
21 TabContents* tabContents_; 21 TabContents* tabContents_;
22 22
23 // Updated asynchronously during a drag to tell us whether or not we should 23 // Updated asynchronously during a drag to tell us whether or not we should
24 // allow the drop. 24 // allow the drop.
25 BOOL isDropTarget_; 25 NSDragOperation current_operation_;
26 26
27 // Keep track of the render view host we're dragging over. If it changes 27 // Keep track of the render view host we're dragging over. If it changes
28 // during a drag, we need to re-send the DragEnter message. 28 // during a drag, we need to re-send the DragEnter message.
29 RenderViewHostIdentifier currentRVH_; 29 RenderViewHostIdentifier currentRVH_;
30 } 30 }
31 31
32 // |contents| is the TabContents representing this tab, used to communicate 32 // |contents| is the TabContents representing this tab, used to communicate
33 // drag&drop messages to WebCore and handle navigation on a successful drop 33 // drag&drop messages to WebCore and handle navigation on a successful drop
34 // (if necessary). 34 // (if necessary).
35 - (id)initWithTabContents:(TabContents*)contents; 35 - (id)initWithTabContents:(TabContents*)contents;
36 36
37 // Call to set whether or not we should allow the drop. Takes effect the 37 // Sets the current operation negotiated by the source and destination,
38 // which determines whether or not we should allow the drop. Takes effect the
38 // next time |-draggingUpdated:| is called. 39 // next time |-draggingUpdated:| is called.
39 - (void)setIsDropTarget:(BOOL)isDropTarget; 40 - (void)setCurrentOperation: (NSDragOperation)operation;
40 41
41 // Messages to send during the tracking of a drag, ususally upon receiving 42 // Messages to send during the tracking of a drag, ususally upon receiving
42 // calls from the view system. Communicates the drag messages to WebCore. 43 // calls from the view system. Communicates the drag messages to WebCore.
43 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)info 44 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)info
44 view:(NSView*)view; 45 view:(NSView*)view;
45 - (void)draggingExited:(id<NSDraggingInfo>)info; 46 - (void)draggingExited:(id<NSDraggingInfo>)info;
46 - (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)info 47 - (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)info
47 view:(NSView*)view; 48 view:(NSView*)view;
48 - (BOOL)performDragOperation:(id<NSDraggingInfo>)info 49 - (BOOL)performDragOperation:(id<NSDraggingInfo>)info
49 view:(NSView*)view; 50 view:(NSView*)view;
(...skipping 13 matching lines...) Expand all
63 fromPasteboard:(NSPasteboard*)pboard; 64 fromPasteboard:(NSPasteboard*)pboard;
64 // Given a point in window coordinates and a view in that window, return a 65 // Given a point in window coordinates and a view in that window, return a
65 // flipped point in the coordinate system of |view|. 66 // flipped point in the coordinate system of |view|.
66 - (NSPoint)flipWindowPointToView:(const NSPoint&)windowPoint 67 - (NSPoint)flipWindowPointToView:(const NSPoint&)windowPoint
67 view:(NSView*)view; 68 view:(NSView*)view;
68 // Given a point in window coordinates and a view in that window, return a 69 // Given a point in window coordinates and a view in that window, return a
69 // flipped point in screen coordinates. 70 // flipped point in screen coordinates.
70 - (NSPoint)flipWindowPointToScreen:(const NSPoint&)windowPoint 71 - (NSPoint)flipWindowPointToScreen:(const NSPoint&)windowPoint
71 view:(NSView*)view; 72 view:(NSView*)view;
72 @end 73 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/web_drag_source.mm ('k') | chrome/browser/cocoa/web_drop_target.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698