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