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_FRAME_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ | 5 #ifndef ASH_FRAME_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ |
6 #define ASH_FRAME_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ | 6 #define ASH_FRAME_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/frame/caption_buttons/caption_button_types.h" | 9 #include "ash/frame/caption_buttons/caption_button_types.h" |
10 #include "ash/frame/caption_buttons/frame_caption_button.h" | 10 #include "ash/frame/caption_buttons/frame_caption_button.h" |
11 #include "ash/wm/workspace/snap_types.h" | 11 #include "ash/wm/workspace/snap_types.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "ui/aura/window_observer.h" | 15 #include "ui/aura/window_observer.h" |
16 #include "ui/views/widget/widget_observer.h" | 16 #include "ui/views/widget/widget_observer.h" |
17 | 17 |
18 namespace views { | 18 namespace views { |
19 class Widget; | 19 class Widget; |
20 } | 20 } |
21 | 21 |
22 namespace ash { | 22 namespace ash { |
23 class FrameMaximizeButtonObserver; | 23 class FrameMaximizeButtonObserver; |
24 | 24 class MaximizeBubbleController; |
25 namespace internal { | |
26 class PhantomWindowController; | 25 class PhantomWindowController; |
27 } | |
28 | |
29 class MaximizeBubbleController; | |
30 | 26 |
31 // Button used for the maximize control on the frame. Handles snapping logic. | 27 // Button used for the maximize control on the frame. Handles snapping logic. |
32 class ASH_EXPORT FrameMaximizeButton : public FrameCaptionButton, | 28 class ASH_EXPORT FrameMaximizeButton : public FrameCaptionButton, |
33 public views::WidgetObserver, | 29 public views::WidgetObserver, |
34 public aura::WindowObserver { | 30 public aura::WindowObserver { |
35 public: | 31 public: |
36 FrameMaximizeButton(views::ButtonListener* listener, | 32 FrameMaximizeButton(views::ButtonListener* listener, |
37 views::Widget* frame); | 33 views::Widget* frame); |
38 virtual ~FrameMaximizeButton(); | 34 virtual ~FrameMaximizeButton(); |
39 | 35 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 MaximizeBubbleFrameState GetMaximizeBubbleFrameState() const; | 133 MaximizeBubbleFrameState GetMaximizeBubbleFrameState() const; |
138 | 134 |
139 // Widget that the maximize button acts on. This is different than the widget | 135 // Widget that the maximize button acts on. This is different than the widget |
140 // which contains the button in the case of AppNonClientFrameViewAsh. | 136 // which contains the button in the case of AppNonClientFrameViewAsh. |
141 views::Widget* frame_; | 137 views::Widget* frame_; |
142 | 138 |
143 // True if we have put observers on |frame_|. | 139 // True if we have put observers on |frame_|. |
144 bool observing_frame_; | 140 bool observing_frame_; |
145 | 141 |
146 // Renders the snap position. | 142 // Renders the snap position. |
147 scoped_ptr<internal::PhantomWindowController> phantom_window_; | 143 scoped_ptr<PhantomWindowController> phantom_window_; |
148 | 144 |
149 // Is snapping enabled? Set on press so that in drag we know whether we | 145 // Is snapping enabled? Set on press so that in drag we know whether we |
150 // should show the snap locations. | 146 // should show the snap locations. |
151 bool is_snap_enabled_; | 147 bool is_snap_enabled_; |
152 | 148 |
153 // Did the user drag far enough to trigger snapping? | 149 // Did the user drag far enough to trigger snapping? |
154 bool exceeded_drag_threshold_; | 150 bool exceeded_drag_threshold_; |
155 | 151 |
156 // Location of the press. | 152 // Location of the press. |
157 gfx::Point press_location_; | 153 gfx::Point press_location_; |
(...skipping 11 matching lines...) Expand all Loading... |
169 int bubble_appearance_delay_ms_; | 165 int bubble_appearance_delay_ms_; |
170 | 166 |
171 ObserverList<FrameMaximizeButtonObserver> observer_list_; | 167 ObserverList<FrameMaximizeButtonObserver> observer_list_; |
172 | 168 |
173 DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton); | 169 DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton); |
174 }; | 170 }; |
175 | 171 |
176 } // namespace ash | 172 } // namespace ash |
177 | 173 |
178 #endif // ASH_FRAME_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ | 174 #endif // ASH_FRAME_CAPTION_BUTTONS_FRAME_MAXIMIZE_BUTTON_H_ |
OLD | NEW |