OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_SHELF_SHELF_WINDOW_TARGETER_H_ | 5 #ifndef ASH_SHELF_SHELF_WINDOW_TARGETER_H_ |
6 #define ASH_SHELF_SHELF_WINDOW_TARGETER_H_ | 6 #define ASH_SHELF_SHELF_WINDOW_TARGETER_H_ |
7 | 7 |
8 #include "ash/shelf/shelf_observer.h" | 8 #include "ash/shelf/shelf_observer.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "ui/aura/window_observer.h" | 10 #include "ui/aura/window_observer.h" |
11 #include "ui/wm/core/easy_resize_window_targeter.h" | 11 #include "ui/wm/core/easy_resize_window_targeter.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 class Shelf; | 15 class Shelf; |
16 class WmWindow; | |
17 | 16 |
18 // ShelfWindowTargeter makes it easier to resize windows with the mouse when the | 17 // ShelfWindowTargeter makes it easier to resize windows with the mouse when the |
19 // window-edge slightly overlaps with the shelf edge. The targeter also makes it | 18 // window-edge slightly overlaps with the shelf edge. The targeter also makes it |
20 // easier to drag the shelf out with touch while it is hidden. | 19 // easier to drag the shelf out with touch while it is hidden. |
21 class ShelfWindowTargeter : public ::wm::EasyResizeWindowTargeter, | 20 class ShelfWindowTargeter : public ::wm::EasyResizeWindowTargeter, |
22 public aura::WindowObserver, | 21 public aura::WindowObserver, |
23 public ShelfObserver { | 22 public ShelfObserver { |
24 public: | 23 public: |
25 ShelfWindowTargeter(WmWindow* container, Shelf* shelf); | 24 ShelfWindowTargeter(aura::Window* container, Shelf* shelf); |
26 ~ShelfWindowTargeter() override; | 25 ~ShelfWindowTargeter() override; |
27 | 26 |
28 private: | 27 private: |
29 // aura::WindowObserver: | 28 // aura::WindowObserver: |
30 void OnWindowDestroying(aura::Window* window) override; | 29 void OnWindowDestroying(aura::Window* window) override; |
31 | 30 |
32 // ShelfObserver: | 31 // ShelfObserver: |
33 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; | 32 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; |
34 | 33 |
35 Shelf* shelf_; | 34 Shelf* shelf_; |
36 | 35 |
37 DISALLOW_COPY_AND_ASSIGN(ShelfWindowTargeter); | 36 DISALLOW_COPY_AND_ASSIGN(ShelfWindowTargeter); |
38 }; | 37 }; |
39 | 38 |
40 } // namespace ash | 39 } // namespace ash |
41 | 40 |
42 #endif // ASH_SHELF_SHELF_WINDOW_TARGETER_H_ | 41 #endif // ASH_SHELF_SHELF_WINDOW_TARGETER_H_ |
OLD | NEW |