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

Side by Side Diff: content/browser/web_contents/web_contents_view_mac.mm

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 <Carbon/Carbon.h> 5 #import <Carbon/Carbon.h>
6 6
7 #import "content/browser/web_contents/web_contents_view_mac.h" 7 #import "content/browser/web_contents/web_contents_view_mac.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 28 matching lines...) Expand all
39 COMPILE_ASSERT_MATCHING_ENUM(DragOperationGeneric); 39 COMPILE_ASSERT_MATCHING_ENUM(DragOperationGeneric);
40 COMPILE_ASSERT_MATCHING_ENUM(DragOperationPrivate); 40 COMPILE_ASSERT_MATCHING_ENUM(DragOperationPrivate);
41 COMPILE_ASSERT_MATCHING_ENUM(DragOperationMove); 41 COMPILE_ASSERT_MATCHING_ENUM(DragOperationMove);
42 COMPILE_ASSERT_MATCHING_ENUM(DragOperationDelete); 42 COMPILE_ASSERT_MATCHING_ENUM(DragOperationDelete);
43 COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery); 43 COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery);
44 44
45 @interface WebContentsViewCocoa (Private) 45 @interface WebContentsViewCocoa (Private)
46 - (id)initWithWebContentsViewMac:(WebContentsViewMac*)w; 46 - (id)initWithWebContentsViewMac:(WebContentsViewMac*)w;
47 - (void)registerDragTypes; 47 - (void)registerDragTypes;
48 - (void)setCurrentDragOperation:(NSDragOperation)operation; 48 - (void)setCurrentDragOperation:(NSDragOperation)operation;
49 - (WebDropData*)dropData;
49 - (void)startDragWithDropData:(const WebDropData&)dropData 50 - (void)startDragWithDropData:(const WebDropData&)dropData
50 dragOperationMask:(NSDragOperation)operationMask 51 dragOperationMask:(NSDragOperation)operationMask
51 image:(NSImage*)image 52 image:(NSImage*)image
52 offset:(NSPoint)offset; 53 offset:(NSPoint)offset;
53 - (void)cancelDeferredClose; 54 - (void)cancelDeferredClose;
54 - (void)clearWebContentsView; 55 - (void)clearWebContentsView;
55 - (void)closeTabAfterEvent; 56 - (void)closeTabAfterEvent;
56 - (void)viewDidBecomeFirstResponder:(NSNotification*)notification; 57 - (void)viewDidBecomeFirstResponder:(NSNotification*)notification;
57 @end 58 @end
58 59
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 242 }
242 243
243 bool WebContentsViewMac::IsDoingDrag() const { 244 bool WebContentsViewMac::IsDoingDrag() const {
244 return false; 245 return false;
245 } 246 }
246 247
247 void WebContentsViewMac::CancelDragAndCloseTab() { 248 void WebContentsViewMac::CancelDragAndCloseTab() {
248 } 249 }
249 250
250 WebDropData* WebContentsViewMac::GetDropData() const { 251 WebDropData* WebContentsViewMac::GetDropData() const {
251 return NULL; 252 return [cocoa_view_ dropData];
252 } 253 }
253 254
254 void WebContentsViewMac::UpdateDragCursor(WebDragOperation operation) { 255 void WebContentsViewMac::UpdateDragCursor(WebDragOperation operation) {
255 [cocoa_view_ setCurrentDragOperation: operation]; 256 [cocoa_view_ setCurrentDragOperation: operation];
256 } 257 }
257 258
258 void WebContentsViewMac::GotFocus() { 259 void WebContentsViewMac::GotFocus() {
259 // This is only used in the views FocusManager stuff but it bleeds through 260 // This is only used in the views FocusManager stuff but it bleeds through
260 // all subclasses. http://crbug.com/21875 261 // all subclasses. http://crbug.com/21875
261 } 262 }
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 - (void)registerDragTypes { 436 - (void)registerDragTypes {
436 NSArray* types = [NSArray arrayWithObjects:NSStringPboardType, 437 NSArray* types = [NSArray arrayWithObjects:NSStringPboardType,
437 NSHTMLPboardType, NSURLPboardType, nil]; 438 NSHTMLPboardType, NSURLPboardType, nil];
438 [self registerForDraggedTypes:types]; 439 [self registerForDraggedTypes:types];
439 } 440 }
440 441
441 - (void)setCurrentDragOperation:(NSDragOperation)operation { 442 - (void)setCurrentDragOperation:(NSDragOperation)operation {
442 [dragDest_ setCurrentOperation:operation]; 443 [dragDest_ setCurrentOperation:operation];
443 } 444 }
444 445
446 - (WebDropData*)dropData {
447 return [dragDest_ currentDropData];
448 }
449
445 - (WebContentsImpl*)webContents { 450 - (WebContentsImpl*)webContents {
446 if (webContentsView_ == NULL) 451 if (webContentsView_ == NULL)
447 return NULL; 452 return NULL;
448 return webContentsView_->web_contents(); 453 return webContentsView_->web_contents();
449 } 454 }
450 455
451 - (void)mouseEvent:(NSEvent*)theEvent { 456 - (void)mouseEvent:(NSEvent*)theEvent {
452 WebContentsImpl* webContents = [self webContents]; 457 WebContentsImpl* webContents = [self webContents];
453 if (webContents && webContents->GetDelegate()) { 458 if (webContents && webContents->GetDelegate()) {
454 NSPoint location = [NSEvent mouseLocation]; 459 NSPoint location = [NSEvent mouseLocation];
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 [[[notification userInfo] objectForKey:kSelectionDirection] 579 [[[notification userInfo] objectForKey:kSelectionDirection]
575 unsignedIntegerValue]; 580 unsignedIntegerValue];
576 if (direction == NSDirectSelection) 581 if (direction == NSDirectSelection)
577 return; 582 return;
578 583
579 [self webContents]-> 584 [self webContents]->
580 FocusThroughTabTraversal(direction == NSSelectingPrevious); 585 FocusThroughTabTraversal(direction == NSSelectingPrevious);
581 } 586 }
582 587
583 @end 588 @end
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_switch_utils.cc ('k') | content/browser/web_contents/web_drag_dest_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698