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

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

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 const DragEventSourceInfo& event_info) { 131 const DragEventSourceInfo& event_info) {
132 // By allowing nested tasks, the code below also allows Close(), 132 // By allowing nested tasks, the code below also allows Close(),
133 // which would deallocate |this|. The same problem can occur while 133 // which would deallocate |this|. The same problem can occur while
134 // processing -sendEvent:, so Close() is deferred in that case. 134 // processing -sendEvent:, so Close() is deferred in that case.
135 // Drags from web content do not come via -sendEvent:, this sets the 135 // Drags from web content do not come via -sendEvent:, this sets the
136 // same flag -sendEvent: would. 136 // same flag -sendEvent: would.
137 base::mac::ScopedSendingEvent sending_event_scoper; 137 base::mac::ScopedSendingEvent sending_event_scoper;
138 138
139 // The drag invokes a nested event loop, arrange to continue 139 // The drag invokes a nested event loop, arrange to continue
140 // processing events. 140 // processing events.
141 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); 141 base::MessageLoop::ScopedNestableTaskAllower allow(
142 base::MessageLoop::current());
142 NSDragOperation mask = static_cast<NSDragOperation>(allowed_operations); 143 NSDragOperation mask = static_cast<NSDragOperation>(allowed_operations);
143 NSPoint offset = NSPointFromCGPoint( 144 NSPoint offset = NSPointFromCGPoint(
144 gfx::PointAtOffsetFromOrigin(image_offset).ToCGPoint()); 145 gfx::PointAtOffsetFromOrigin(image_offset).ToCGPoint());
145 [cocoa_view_ startDragWithDropData:drop_data 146 [cocoa_view_ startDragWithDropData:drop_data
146 dragOperationMask:mask 147 dragOperationMask:mask
147 image:gfx::NSImageFromImageSkia(image) 148 image:gfx::NSImageFromImageSkia(image)
148 offset:offset]; 149 offset:offset];
149 } 150 }
150 151
151 void WebContentsViewMac::OnTabCrashed(base::TerminationStatus /* status */, 152 void WebContentsViewMac::OnTabCrashed(base::TerminationStatus /* status */,
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 [[[notification userInfo] objectForKey:kSelectionDirection] 563 [[[notification userInfo] objectForKey:kSelectionDirection]
563 unsignedIntegerValue]; 564 unsignedIntegerValue];
564 if (direction == NSDirectSelection) 565 if (direction == NSDirectSelection)
565 return; 566 return;
566 567
567 [self webContents]-> 568 [self webContents]->
568 FocusThroughTabTraversal(direction == NSSelectingPrevious); 569 FocusThroughTabTraversal(direction == NSSelectingPrevious);
569 } 570 }
570 571
571 @end 572 @end
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura.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