OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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 AURA_WINDOW_MANAGER_H_ | |
6 #define AURA_WINDOW_MANAGER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/logging.h" | |
10 #include "ui/gfx/point.h" | |
11 | |
12 namespace aura { | |
13 | |
14 class Window; | |
15 class MouseEvent; | |
16 | |
17 // An object that filters events sent to an owner window, potentially performing | |
18 // adjustments to the window's position, size and z-index. | |
19 // | |
20 // TODO(beng): Make this into an interface so we can have specializations for | |
21 // different types of Window and product. | |
22 class WindowManager { | |
23 public: | |
24 explicit WindowManager(Window* owner); | |
25 ~WindowManager(); | |
26 | |
27 // Try to handle |event| (before the owner's delegate gets a chance to). | |
28 // Returns true if the event was handled by the WindowManager and should not | |
29 // be forwarded to the owner's delegate. | |
30 bool OnMouseEvent(MouseEvent* event); | |
31 | |
32 private: | |
33 // Moves the owner window and all of its parents to the front of their | |
34 // respective z-orders. | |
35 void MoveWindowToFront(); | |
36 | |
37 Window* owner_; | |
38 gfx::Point mouse_down_offset_; | |
39 gfx::Point window_location_; | |
40 int window_component_; | |
41 | |
42 DISALLOW_COPY_AND_ASSIGN(WindowManager); | |
43 }; | |
44 | |
45 } // namespace aura | |
46 | |
47 #endif // AURA_WINDOW_MANAGER_H_ | |
OLD | NEW |