OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RESIZE_HANDLE_WINDOW_TARGETER_H_ | 5 #ifndef ASH_WM_RESIZE_HANDLE_WINDOW_TARGETER_H_ |
6 #define ASH_WM_RESIZE_HANDLE_WINDOW_TARGETER_H_ | 6 #define ASH_WM_RESIZE_HANDLE_WINDOW_TARGETER_H_ |
7 | 7 |
8 #include "ash/common/wm/window_state_observer.h" | 8 #include "ash/common/wm/window_state_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/aura/window_targeter.h" | 11 #include "ui/aura/window_targeter.h" |
12 #include "ui/gfx/geometry/insets.h" | 12 #include "ui/gfx/geometry/insets.h" |
13 | 13 |
14 namespace ash { | 14 namespace ash { |
15 | 15 |
16 class WmImmersiveFullscreenController; | 16 class ImmersiveFullscreenController; |
17 | 17 |
18 // To allow easy resize, the resize handles should slightly overlap the content | 18 // To allow easy resize, the resize handles should slightly overlap the content |
19 // area of non-maximized and non-fullscreen windows. For immersive fullscreen | 19 // area of non-maximized and non-fullscreen windows. For immersive fullscreen |
20 // windows, this targeter makes sure that touch-events towards the top of the | 20 // windows, this targeter makes sure that touch-events towards the top of the |
21 // screen are targeted to the window itself (instead of a child window that may | 21 // screen are targeted to the window itself (instead of a child window that may |
22 // otherwise have been targeted) when the top-of-window views are not revealed. | 22 // otherwise have been targeted) when the top-of-window views are not revealed. |
23 class ResizeHandleWindowTargeter : public wm::WindowStateObserver, | 23 class ResizeHandleWindowTargeter : public wm::WindowStateObserver, |
24 public aura::WindowObserver, | 24 public aura::WindowObserver, |
25 public aura::WindowTargeter { | 25 public aura::WindowTargeter { |
26 public: | 26 public: |
27 ResizeHandleWindowTargeter(aura::Window* window, | 27 ResizeHandleWindowTargeter(aura::Window* window, |
28 WmImmersiveFullscreenController* immersive); | 28 ImmersiveFullscreenController* immersive); |
29 ~ResizeHandleWindowTargeter() override; | 29 ~ResizeHandleWindowTargeter() override; |
30 | 30 |
31 private: | 31 private: |
32 // wm::WindowStateObserver: | 32 // wm::WindowStateObserver: |
33 void OnPostWindowStateTypeChange(wm::WindowState* window_state, | 33 void OnPostWindowStateTypeChange(wm::WindowState* window_state, |
34 wm::WindowStateType old_type) override; | 34 wm::WindowStateType old_type) override; |
35 // aura::WindowObserver: | 35 // aura::WindowObserver: |
36 void OnWindowDestroying(aura::Window* window) override; | 36 void OnWindowDestroying(aura::Window* window) override; |
37 | 37 |
38 // aura::WindowTargeter: | 38 // aura::WindowTargeter: |
39 aura::Window* FindTargetForLocatedEvent(aura::Window* window, | 39 aura::Window* FindTargetForLocatedEvent(aura::Window* window, |
40 ui::LocatedEvent* event) override; | 40 ui::LocatedEvent* event) override; |
41 bool SubtreeShouldBeExploredForEvent(aura::Window* window, | 41 bool SubtreeShouldBeExploredForEvent(aura::Window* window, |
42 const ui::LocatedEvent& event) override; | 42 const ui::LocatedEvent& event) override; |
43 | 43 |
44 // The targeter does not take ownership of |window_| or | 44 // The targeter does not take ownership of |window_| or |
45 // |immersive_controller_|. | 45 // |immersive_controller_|. |
46 aura::Window* window_; | 46 aura::Window* window_; |
47 gfx::Insets frame_border_inset_; | 47 gfx::Insets frame_border_inset_; |
48 WmImmersiveFullscreenController* immersive_controller_; | 48 ImmersiveFullscreenController* immersive_controller_; |
49 | 49 |
50 DISALLOW_COPY_AND_ASSIGN(ResizeHandleWindowTargeter); | 50 DISALLOW_COPY_AND_ASSIGN(ResizeHandleWindowTargeter); |
51 }; | 51 }; |
52 | 52 |
53 } // namespace ash | 53 } // namespace ash |
54 | 54 |
55 #endif // ASH_WM_RESIZE_HANDLE_WINDOW_TARGETER_H_ | 55 #endif // ASH_WM_RESIZE_HANDLE_WINDOW_TARGETER_H_ |
OLD | NEW |