OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ | 5 #ifndef ASH_WM_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ |
6 #define ASH_WM_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ | 6 #define ASH_WM_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/wm/caption_buttons/caption_button_types.h" | 9 #include "ash/wm/caption_buttons/caption_button_types.h" |
10 #include "ash/wm/caption_buttons/frame_caption_button.h" | 10 #include "ash/wm/caption_buttons/frame_caption_button.h" |
11 #include "ash/wm/window_state_observer.h" | |
12 #include "ash/wm/workspace/snap_types.h" | 11 #include "ash/wm/workspace/snap_types.h" |
13 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
14 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
15 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
16 #include "ui/aura/window_observer.h" | 15 #include "ui/aura/window_observer.h" |
17 #include "ui/views/widget/widget_observer.h" | 16 #include "ui/views/widget/widget_observer.h" |
18 | 17 |
19 namespace views { | 18 namespace views { |
20 class Widget; | 19 class Widget; |
21 } | 20 } |
22 | 21 |
23 namespace ash { | 22 namespace ash { |
24 class FrameMaximizeButtonObserver; | 23 class FrameMaximizeButtonObserver; |
25 | 24 |
26 namespace internal { | 25 namespace internal { |
27 class PhantomWindowController; | 26 class PhantomWindowController; |
28 class SnapSizer; | 27 class SnapSizer; |
29 } | 28 } |
30 | 29 |
31 class MaximizeBubbleController; | 30 class MaximizeBubbleController; |
32 | 31 |
33 // Button used for the maximize control on the frame. Handles snapping logic. | 32 // Button used for the maximize control on the frame. Handles snapping logic. |
34 class ASH_EXPORT FrameMaximizeButton : public FrameCaptionButton, | 33 class ASH_EXPORT FrameMaximizeButton : public FrameCaptionButton, |
35 public views::WidgetObserver, | 34 public views::WidgetObserver, |
36 public aura::WindowObserver, | 35 public aura::WindowObserver { |
37 public wm::WindowStateObserver { | |
38 public: | 36 public: |
39 FrameMaximizeButton(views::ButtonListener* listener, | 37 FrameMaximizeButton(views::ButtonListener* listener, |
40 views::Widget* frame); | 38 views::Widget* frame); |
41 virtual ~FrameMaximizeButton(); | 39 virtual ~FrameMaximizeButton(); |
42 | 40 |
43 void AddObserver(FrameMaximizeButtonObserver* observer); | 41 void AddObserver(FrameMaximizeButtonObserver* observer); |
44 void RemoveObserver(FrameMaximizeButtonObserver* observer); | 42 void RemoveObserver(FrameMaximizeButtonObserver* observer); |
45 | 43 |
46 // Updates |snap_type_| based on a a given snap type. This is used by | 44 // Updates |snap_type_| based on a a given snap type. This is used by |
47 // external hover events from the button menu. | 45 // external hover events from the button menu. |
(...skipping 14 matching lines...) Expand all Loading... |
62 | 60 |
63 // WindowObserver overrides: | 61 // WindowObserver overrides: |
64 virtual void OnWindowBoundsChanged(aura::Window* window, | 62 virtual void OnWindowBoundsChanged(aura::Window* window, |
65 const gfx::Rect& old_bounds, | 63 const gfx::Rect& old_bounds, |
66 const gfx::Rect& new_bounds) OVERRIDE; | 64 const gfx::Rect& new_bounds) OVERRIDE; |
67 virtual void OnWindowPropertyChanged(aura::Window* window, | 65 virtual void OnWindowPropertyChanged(aura::Window* window, |
68 const void* key, | 66 const void* key, |
69 intptr_t old) OVERRIDE; | 67 intptr_t old) OVERRIDE; |
70 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 68 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
71 | 69 |
72 // wm::WindowStateObserver override: | |
73 virtual void OnWindowShowTypeChanged(wm::WindowState* window_state, | |
74 wm::WindowShowType old_type) OVERRIDE; | |
75 | |
76 // WidgetObserver overrides: | 70 // WidgetObserver overrides: |
77 virtual void OnWidgetActivationChanged(views::Widget* widget, | 71 virtual void OnWidgetActivationChanged(views::Widget* widget, |
78 bool active) OVERRIDE; | 72 bool active) OVERRIDE; |
79 | 73 |
80 // ImageButton overrides: | 74 // ImageButton overrides: |
81 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 75 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
82 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 76 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; |
83 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 77 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; |
84 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 78 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; |
85 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 79 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 int bubble_appearance_delay_ms_; | 184 int bubble_appearance_delay_ms_; |
191 | 185 |
192 ObserverList<FrameMaximizeButtonObserver> observer_list_; | 186 ObserverList<FrameMaximizeButtonObserver> observer_list_; |
193 | 187 |
194 DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton); | 188 DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton); |
195 }; | 189 }; |
196 | 190 |
197 } // namespace ash | 191 } // namespace ash |
198 | 192 |
199 #endif // ASH_WM_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ | 193 #endif // ASH_WM_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ |
OLD | NEW |