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

Side by Side Diff: ui/views/cocoa/cocoa_window_move_loop.h

Issue 1747803003: MacViews: Implement Tab Dragging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix include. 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 unified diff | Download patch
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | ui/views/cocoa/cocoa_window_move_loop.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_COCOA_COCOA_WINDOW_MOVE_LOOP_H_
6 #define UI_VIEWS_COCOA_COCOA_WINDOW_MOVE_LOOP_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 #include "base/callback.h"
11 #include "base/memory/weak_ptr.h"
12 #include "ui/views/widget/widget.h"
13
14 namespace views {
15 class BridgedNativeWidget;
16
17 // Used by views::BridgedNativeWidget when dragging detached tabs.
18 class CocoaWindowMoveLoop {
19 public:
20 CocoaWindowMoveLoop(BridgedNativeWidget* owner,
21 const NSPoint& initial_mouse_in_screen);
22 ~CocoaWindowMoveLoop();
23
24 // Initiates the drag until a mouse up event is observed, or End() is called.
25 Widget::MoveLoopResult Run();
26 void End();
27
28 private:
29 enum LoopExitReason {
30 ENDED_EXTERNALLY,
31 MOUSE_UP,
32 WINDOW_DESTROYED,
33 };
34
35 BridgedNativeWidget* owner_; // Weak. Owns this.
36
37 // Initial mouse location at the time before the CocoaWindowMoveLoop is
38 // created.
39 NSPoint initial_mouse_in_screen_;
40
41 // Pointer to a stack variable holding the exit reason.
42 LoopExitReason* exit_reason_ref_ = nullptr;
43 base::Closure quit_closure_;
44
45 // WeakPtrFactory for event monitor safety.
46 base::WeakPtrFactory<CocoaWindowMoveLoop> weak_factory_;
47
48 DISALLOW_COPY_AND_ASSIGN(CocoaWindowMoveLoop);
49 };
50
51 } // namespace views
52
53 #endif // UI_VIEWS_COCOA_COCOA_WINDOW_MOVE_LOOP_H_
OLDNEW
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | ui/views/cocoa/cocoa_window_move_loop.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698