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

Side by Side Diff: ash/wm/toplevel_window_event_handler.h

Issue 12441010: Attach panel while dragging to bring it in front of other panels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get workspace event handler from workspace controller. Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ 5 #ifndef ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_
6 #define ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ 6 #define ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 19 matching lines...) Expand all
30 class WindowResizer; 30 class WindowResizer;
31 31
32 class ASH_EXPORT ToplevelWindowEventHandler 32 class ASH_EXPORT ToplevelWindowEventHandler
33 : public ui::EventHandler, 33 : public ui::EventHandler,
34 public aura::client::WindowMoveClient, 34 public aura::client::WindowMoveClient,
35 public DisplayController::Observer { 35 public DisplayController::Observer {
36 public: 36 public:
37 explicit ToplevelWindowEventHandler(aura::Window* owner); 37 explicit ToplevelWindowEventHandler(aura::Window* owner);
38 virtual ~ToplevelWindowEventHandler(); 38 virtual ~ToplevelWindowEventHandler();
39 39
40 // Pass the WindowResizer to a different ToplevelWindowEventHandler which
41 // will continue the drag.
42 virtual void PassResizer(ToplevelWindowEventHandler* new_owner);
43
40 // Overridden from ui::EventHandler: 44 // Overridden from ui::EventHandler:
41 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; 45 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
42 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; 46 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
43 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 47 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
44 48
45 // Overridden form aura::client::WindowMoveClient: 49 // Overridden form aura::client::WindowMoveClient:
46 virtual aura::client::WindowMoveResult RunMoveLoop( 50 virtual aura::client::WindowMoveResult RunMoveLoop(
47 aura::Window* source, 51 aura::Window* source,
48 const gfx::Vector2d& drag_offset, 52 const gfx::Vector2d& drag_offset,
49 aura::client::WindowMoveSource move_source) OVERRIDE; 53 aura::client::WindowMoveSource move_source) OVERRIDE;
50 virtual void EndMoveLoop() OVERRIDE; 54 virtual void EndMoveLoop() OVERRIDE;
51 55
52 // Overridden form ash::DisplayController::Observer: 56 // Overridden from ash::DisplayController::Observer:
53 virtual void OnDisplayConfigurationChanging() OVERRIDE; 57 virtual void OnDisplayConfigurationChanging() OVERRIDE;
54 58
55 private: 59 private:
56 class ScopedWindowResizer; 60 class ScopedWindowResizer;
57 61
58 enum DragCompletionStatus { 62 enum DragCompletionStatus {
59 DRAG_COMPLETE, 63 DRAG_COMPLETE,
60 DRAG_REVERT 64 DRAG_REVERT
61 }; 65 };
62 66
67 virtual void AcceptResizer(WindowResizer* resizer, bool in_gesture_drag);
68
63 void CreateScopedWindowResizer(aura::Window* window, 69 void CreateScopedWindowResizer(aura::Window* window,
64 const gfx::Point& point_in_parent, 70 const gfx::Point& point_in_parent,
65 int window_component); 71 int window_component);
66 72
67 // Finishes the drag. 73 // Finishes the drag.
68 void CompleteDrag(DragCompletionStatus status, int event_flags); 74 void CompleteDrag(DragCompletionStatus status, int event_flags);
69 75
70 void HandleMousePressed(aura::Window* target, ui::MouseEvent* event); 76 void HandleMousePressed(aura::Window* target, ui::MouseEvent* event);
71 void HandleMouseReleased(aura::Window* target, ui::MouseEvent* event); 77 void HandleMouseReleased(aura::Window* target, ui::MouseEvent* event);
72 78
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // Used to track if this object is deleted while running a nested message 114 // Used to track if this object is deleted while running a nested message
109 // loop. If non-null the destructor sets this to true. 115 // loop. If non-null the destructor sets this to true.
110 bool* destroyed_; 116 bool* destroyed_;
111 117
112 DISALLOW_COPY_AND_ASSIGN(ToplevelWindowEventHandler); 118 DISALLOW_COPY_AND_ASSIGN(ToplevelWindowEventHandler);
113 }; 119 };
114 120
115 } // namespace aura 121 } // namespace aura
116 122
117 #endif // ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ 123 #endif // ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698