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

Unified Diff: ui/views/cocoa/cocoa_drag_drop_manager.h

Issue 1964283002: MacViews: Implemented Drag & Drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/cocoa_drag_drop_manager.h
diff --git a/ui/views/cocoa/cocoa_drag_drop_manager.h b/ui/views/cocoa/cocoa_drag_drop_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..51520aac8158d5311ec90f87873483044859b8de
--- /dev/null
+++ b/ui/views/cocoa/cocoa_drag_drop_manager.h
@@ -0,0 +1,67 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_COCOA_COCOA_DRAG_DROP_MANAGER_H_
+#define UI_VIEWS_COCOA_COCOA_DRAG_DROP_MANAGER_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include <memory>
+#include <vector>
+
+#import "base/mac/scoped_nsobject.h"
+#include "base/macros.h"
+#include "ui/base/dragdrop/drag_drop_types.h"
+#include "ui/views/views_export.h"
+#include "ui/views/widget/drop_helper.h"
+
+@class CocoaDragSourceProvider;
+class DropHelper;
+
+namespace gfx {
+class Point;
+} // namespace gfx
+
+namespace ui {
+class OSExchangeData;
+} // namespace ui
+using ui::OSExchangeData;
+
+namespace views {
+
+class BridgedNativeWidget;
+
+class VIEWS_EXPORT CocoaDragDropManager {
tapted 2016/05/11 12:36:15 This class looks a lot like an aura::DragDropClien
spqchan 2016/05/23 21:26:21 Sounds good. I renamed most of my methods accordin
+ public:
+ explicit CocoaDragDropManager(BridgedNativeWidget* view);
+ ~CocoaDragDropManager();
+
+ void BeginDrag(const ui::OSExchangeData& data,
+ const gfx::Point& location,
+ int operation,
+ ui::DragDropTypes::DragEventSource source);
+
+ NSDragOperation DraggingOver(id<NSDraggingInfo>);
+
+ NSDragOperation OnDrop(id<NSDraggingInfo> sender);
+
+ void EndDrag();
+
+ void SetRootView(View* view);
+
+ private:
+ gfx::Point LocationInView(NSPoint point) const;
+
+ base::scoped_nsobject<CocoaDragSourceProvider> drag_source_;
+ std::unique_ptr<DropHelper> drop_helper_;
+
+ int operation_;
+ BridgedNativeWidget* bridge_;
+
+ DISALLOW_COPY_AND_ASSIGN(CocoaDragDropManager);
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_COCOA_COCOA_DRAG_DROP_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698