OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string16.h" | 7 #include "base/string16.h" |
8 | 8 |
9 class GURL; | 9 class GURL; |
10 class RenderViewHost; | 10 class RenderViewHost; |
11 class TabContents; | 11 class TabContents; |
12 struct WebDropData; | 12 struct WebDropData; |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 class WebDragDestDelegate; | 15 class WebDragDestDelegate; |
16 } | 16 } |
17 | 17 |
18 // A typedef for a RenderViewHost used for comparison purposes only. | 18 // A typedef for a RenderViewHost used for comparison purposes only. |
19 typedef RenderViewHost* RenderViewHostIdentifier; | 19 typedef RenderViewHost* RenderViewHostIdentifier; |
20 | 20 |
21 // 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 |
22 // 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 |
23 // only for processing during a drag. | 23 // only for processing during a drag. |
24 | 24 |
25 @interface WebDropTarget : NSObject { | 25 @interface WebDragDest : NSObject { |
26 @private | 26 @private |
27 // Our associated TabContents. Weak reference. | 27 // Our associated TabContents. Weak reference. |
28 TabContents* tabContents_; | 28 TabContents* tabContents_; |
29 | 29 |
30 // Delegate; weak. | 30 // Delegate; weak. |
31 content::WebDragDestDelegate* delegate_; | 31 content::WebDragDestDelegate* delegate_; |
32 | 32 |
33 // 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 |
34 // allow the drop. | 34 // allow the drop. |
35 NSDragOperation current_operation_; | 35 NSDragOperation current_operation_; |
(...skipping 21 matching lines...) Expand all Loading... |
57 view:(NSView*)view; | 57 view:(NSView*)view; |
58 - (void)draggingExited:(id<NSDraggingInfo>)info; | 58 - (void)draggingExited:(id<NSDraggingInfo>)info; |
59 - (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)info | 59 - (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)info |
60 view:(NSView*)view; | 60 view:(NSView*)view; |
61 - (BOOL)performDragOperation:(id<NSDraggingInfo>)info | 61 - (BOOL)performDragOperation:(id<NSDraggingInfo>)info |
62 view:(NSView*)view; | 62 view:(NSView*)view; |
63 | 63 |
64 @end | 64 @end |
65 | 65 |
66 // Public use only for unit tests. | 66 // Public use only for unit tests. |
67 @interface WebDropTarget(Testing) | 67 @interface WebDragDest(Testing) |
68 // Given |data|, which should not be nil, fill it in using the contents of the | 68 // Given |data|, which should not be nil, fill it in using the contents of the |
69 // given pasteboard. | 69 // given pasteboard. |
70 - (void)populateWebDropData:(WebDropData*)data | 70 - (void)populateWebDropData:(WebDropData*)data |
71 fromPasteboard:(NSPasteboard*)pboard; | 71 fromPasteboard:(NSPasteboard*)pboard; |
72 // Given a point in window coordinates and a view in that window, return a | 72 // Given a point in window coordinates and a view in that window, return a |
73 // flipped point in the coordinate system of |view|. | 73 // flipped point in the coordinate system of |view|. |
74 - (NSPoint)flipWindowPointToView:(const NSPoint&)windowPoint | 74 - (NSPoint)flipWindowPointToView:(const NSPoint&)windowPoint |
75 view:(NSView*)view; | 75 view:(NSView*)view; |
76 // Given a point in window coordinates and a view in that window, return a | 76 // Given a point in window coordinates and a view in that window, return a |
77 // flipped point in screen coordinates. | 77 // flipped point in screen coordinates. |
78 - (NSPoint)flipWindowPointToScreen:(const NSPoint&)windowPoint | 78 - (NSPoint)flipWindowPointToScreen:(const NSPoint&)windowPoint |
79 view:(NSView*)view; | 79 view:(NSView*)view; |
80 @end | 80 @end |
OLD | NEW |