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

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: Forgot to add the test Created 4 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 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 da6acf2f6a6058fe3d52ded46b29a8c893c4e8c6..55c7224c660dc387ff4ddf91814811106a28e831 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"
@@ -336,6 +337,7 @@ BridgedNativeWidget::BridgedNativeWidget(NativeWidgetMac* parent)
DCHECK(parent);
window_delegate_.reset(
[[ViewsNSWindowDelegate alloc] initWithBridgedNativeWidget:this]);
+ drag_drop_client_.reset(new DragDropClientMac(this));
tapted 2016/05/24 08:06:01 can this be done at the end of BridgedNativeWidget
spqchan 2016/05/26 01:56:53 Done.
}
BridgedNativeWidget::~BridgedNativeWidget() {
@@ -527,6 +529,8 @@ void BridgedNativeWidget::SetRootView(views::View* view) {
if (view) {
bridged_view_.reset([[BridgedContentView alloc] initWithView:view]);
+ drag_drop_client_->SetRootView(view);
tapted 2016/05/24 08:06:01 hopefully we don't need this if we can avoid some
+
// 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