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

Unified Diff: ui/views/cocoa/bridged_native_widget.mm

Issue 1964283002: MacViews: Implemented Drag & Drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for dcheng Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/cocoa/bridged_native_widget.mm
diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm
index 1c9560f2e8834aeb19225abd760819145854b361..68479bced1502e2d6e398443c15607c1fe6707e5 100644
--- a/ui/views/cocoa/bridged_native_widget.mm
+++ b/ui/views/cocoa/bridged_native_widget.mm
@@ -24,6 +24,7 @@
#import "ui/gfx/mac/coordinate_conversion.h"
#import "ui/gfx/mac/nswindow_frame_controls.h"
#import "ui/views/cocoa/bridged_content_view.h"
+#import "ui/views/cocoa/drag_drop_client_mac.h"
#import "ui/views/cocoa/cocoa_mouse_capture.h"
#include "ui/views/cocoa/tooltip_manager_mac.h"
#import "ui/views/cocoa/views_nswindow_delegate.h"
@@ -519,6 +520,7 @@ void BridgedNativeWidget::SetRootView(views::View* view) {
// and replaced, pointing at the new view.
DCHECK(!view || !compositor_widget_);
+ drag_drop_client_.reset();
[bridged_view_ clearView];
bridged_view_.reset();
// Note that there can still be references to the old |bridged_view_|
@@ -527,6 +529,8 @@ void BridgedNativeWidget::SetRootView(views::View* view) {
if (view) {
bridged_view_.reset([[BridgedContentView alloc] initWithView:view]);
+ drag_drop_client_.reset(new DragDropClientMac(this, view));
+
// Objective C initializers can return nil. However, if |view| is non-NULL
// this should be treated as an error and caught early.
CHECK(bridged_view_);

Powered by Google App Engine
This is Rietveld 408576698