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

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

Issue 2505113002: Drag-and-drop: Target drag messages to specific RenderWidgets. (Closed)
Patch Set: Small fix. Created 4 years, 1 month 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
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 bounds.origin.y = [screen frame].size.height - bounds.origin.y 167 bounds.origin.y = [screen frame].size.height - bounds.origin.y
168 - bounds.size.height; 168 - bounds.size.height;
169 *out = gfx::Rect(NSRectToCGRect(bounds)); 169 *out = gfx::Rect(NSRectToCGRect(bounds));
170 } 170 }
171 171
172 void WebContentsViewMac::StartDragging( 172 void WebContentsViewMac::StartDragging(
173 const DropData& drop_data, 173 const DropData& drop_data,
174 WebDragOperationsMask allowed_operations, 174 WebDragOperationsMask allowed_operations,
175 const gfx::ImageSkia& image, 175 const gfx::ImageSkia& image,
176 const gfx::Vector2d& image_offset, 176 const gfx::Vector2d& image_offset,
177 const DragEventSourceInfo& event_info) { 177 const DragEventSourceInfo& event_info,
178 RenderWidgetHostImpl* source_rwh) {
178 // By allowing nested tasks, the code below also allows Close(), 179 // By allowing nested tasks, the code below also allows Close(),
179 // which would deallocate |this|. The same problem can occur while 180 // which would deallocate |this|. The same problem can occur while
180 // processing -sendEvent:, so Close() is deferred in that case. 181 // processing -sendEvent:, so Close() is deferred in that case.
181 // Drags from web content do not come via -sendEvent:, this sets the 182 // Drags from web content do not come via -sendEvent:, this sets the
182 // same flag -sendEvent: would. 183 // same flag -sendEvent: would.
183 base::mac::ScopedSendingEvent sending_event_scoper; 184 base::mac::ScopedSendingEvent sending_event_scoper;
184 185
185 // The drag invokes a nested event loop, arrange to continue 186 // The drag invokes a nested event loop, arrange to continue
186 // processing events. 187 // processing events.
187 base::MessageLoop::ScopedNestableTaskAllower allow( 188 base::MessageLoop::ScopedNestableTaskAllower allow(
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 719
719 - (void)viewDidHide { 720 - (void)viewDidHide {
720 [self updateWebContentsVisibility]; 721 [self updateWebContentsVisibility];
721 } 722 }
722 723
723 - (void)viewDidUnhide { 724 - (void)viewDidUnhide {
724 [self updateWebContentsVisibility]; 725 [self updateWebContentsVisibility];
725 } 726 }
726 727
727 @end 728 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698