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

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

Issue 10834016: Alternative: access the WebContentsView directly without an interface method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « content/browser/web_contents/web_contents_view_mac.h ('k') | no next file » | 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) 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 NSPoint location = [NSEvent mouseLocation]; 405 NSPoint location = [NSEvent mouseLocation];
406 if ([theEvent type] == NSMouseMoved) 406 if ([theEvent type] == NSMouseMoved)
407 webContents->GetDelegate()->ContentsMouseEvent( 407 webContents->GetDelegate()->ContentsMouseEvent(
408 webContents, gfx::Point(location.x, location.y), true); 408 webContents, gfx::Point(location.x, location.y), true);
409 if ([theEvent type] == NSMouseExited) 409 if ([theEvent type] == NSMouseExited)
410 webContents->GetDelegate()->ContentsMouseEvent( 410 webContents->GetDelegate()->ContentsMouseEvent(
411 webContents, gfx::Point(location.x, location.y), false); 411 webContents, gfx::Point(location.x, location.y), false);
412 } 412 }
413 } 413 }
414 414
415 - (void)setMouseDownCanMoveWindow:(BOOL)canMove {
416 mouseDownCanMoveWindow_ = canMove;
417 }
418
415 - (BOOL)mouseDownCanMoveWindow { 419 - (BOOL)mouseDownCanMoveWindow {
416 // This is needed to prevent mouseDowns from moving the window 420 // This is needed to prevent mouseDowns from moving the window
417 // around. The default implementation returns YES only for opaque 421 // around. The default implementation returns YES only for opaque
418 // views. WebContentsViewCocoa does not draw itself in any way, but 422 // views. WebContentsViewCocoa does not draw itself in any way, but
419 // its subviews do paint their entire frames. Returning NO here 423 // its subviews do paint their entire frames. Returning NO here
420 // saves us the effort of overriding this method in every possible 424 // saves us the effort of overriding this method in every possible
421 // subview. 425 // subview.
422 return NO; 426 return mouseDownCanMoveWindow_;
423 } 427 }
424 428
425 - (void)pasteboard:(NSPasteboard*)sender provideDataForType:(NSString*)type { 429 - (void)pasteboard:(NSPasteboard*)sender provideDataForType:(NSString*)type {
426 [dragSource_ lazyWriteToPasteboard:sender 430 [dragSource_ lazyWriteToPasteboard:sender
427 forType:type]; 431 forType:type];
428 } 432 }
429 433
430 - (void)startDragWithDropData:(const WebDropData&)dropData 434 - (void)startDragWithDropData:(const WebDropData&)dropData
431 dragOperationMask:(NSDragOperation)operationMask 435 dragOperationMask:(NSDragOperation)operationMask
432 image:(NSImage*)image 436 image:(NSImage*)image
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 [[[notification userInfo] objectForKey:kSelectionDirection] 529 [[[notification userInfo] objectForKey:kSelectionDirection]
526 unsignedIntegerValue]; 530 unsignedIntegerValue];
527 if (direction == NSDirectSelection) 531 if (direction == NSDirectSelection)
528 return; 532 return;
529 533
530 [self webContents]-> 534 [self webContents]->
531 FocusThroughTabTraversal(direction == NSSelectingPrevious); 535 FocusThroughTabTraversal(direction == NSSelectingPrevious);
532 } 536 }
533 537
534 @end 538 @end
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698