OLD | NEW |
---|---|
(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 "ui/views/widget/widget.h" | |
11 | |
12 namespace views { | |
13 class BridgedNativeWidget; | |
14 | |
15 // Used by views::BridgedNativeWidget when dragging detached tabs. | |
16 class CocoaWindowMoveLoop { | |
17 public: | |
18 CocoaWindowMoveLoop(BridgedNativeWidget* owner, | |
19 const NSPoint& initial_mouse_in_screen); | |
20 ~CocoaWindowMoveLoop(); | |
21 | |
22 // Initiates the drag until a mouse up event is observed, or End() is called. | |
23 Widget::MoveLoopResult Run(); | |
24 void End(); | |
25 | |
26 private: | |
27 enum LoopExitReason { | |
28 ENDED_EXTERNALLY, | |
29 MOUSE_UP, | |
30 WINDOW_DESTROYED, | |
31 }; | |
32 | |
33 void OnPositionChanged(); | |
tapted
2016/06/06 07:12:36
remove - I think it's orphaned now
themblsha
2016/06/06 17:20:27
Done.
| |
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_; | |
tapted
2016/06/06 07:12:36
nit: #include "base/callback.h"
themblsha
2016/06/06 17:20:27
Done.
| |
44 | |
45 // WeakPtrFactory for event monitor safety. | |
46 base::WeakPtrFactory<CocoaWindowMoveLoop> weak_factory_; | |
tapted
2016/06/06 07:12:36
nit: #include "base/memory/weak_ptr.h"
themblsha
2016/06/06 17:20:27
Done.
| |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(CocoaWindowMoveLoop); | |
49 }; | |
50 | |
51 } // namespace views | |
52 | |
53 #endif // UI_VIEWS_COCOA_COCOA_WINDOW_MOVE_LOOP_H_ | |
OLD | NEW |