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

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: Extract CocoaWindowMoveLoop, fix review issues. Created 4 years, 9 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
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 #include "ui/views/widget/widget.h"
9
10 namespace views {
11 class BridgedNativeWidget;
12
13 // Used by views::BridgedNativeWidget
14 class CocoaWindowMoveLoop {
15 public:
16 explicit CocoaWindowMoveLoop(BridgedNativeWidget* owner);
17 ~CocoaWindowMoveLoop();
18
19 Widget::MoveLoopResult Run();
20 void End();
21
22 private:
23 enum LoopExitReason {
24 ENDED_EXTERNALLY,
25 ESCAPE_PRESSED,
26 MOUSE_UP,
27 WINDOW_DESTROYED,
28 };
29
30 BridgedNativeWidget* owner_; // Weak. Owns this.
31 scoped_ptr<base::RunLoop> run_loop_;
32 id monitor_ = nil;
33
34 // Pointer to a stack variable holding the exit reason.
35 LoopExitReason* exit_reason_ref_ = nullptr;
36 base::Closure quit_closure_;
37
38 // WeakPtrFactory for event monitor safety.
39 base::WeakPtrFactory<CocoaWindowMoveLoop> weak_factory_;
40
41 DISALLOW_COPY_AND_ASSIGN(CocoaWindowMoveLoop);
42 };
43
44 } // namespace views
45
46 #endif // UI_VIEWS_COCOA_COCOA_WINDOW_MOVE_LOOP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698