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_CAPTION_BUTTON_CONTAINER_VIEW_H_ | 5 #ifndef ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ |
6 #define ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ | 6 #define ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ |
7 | 7 |
8 #include <map> | |
flackr
2014/05/08 19:02:21
Unused?
jonross
2014/05/08 21:15:40
Cpplint, used outside my changed.
flackr
2014/05/09 14:15:14
Ah, sorry about that, good work.
| |
9 | |
8 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
9 #include "ash/frame/caption_buttons/alternate_frame_size_button_delegate.h" | 11 #include "ash/frame/caption_buttons/alternate_frame_size_button_delegate.h" |
12 #include "ui/compositor/layer_animation_observer.h" | |
10 #include "ui/views/controls/button/button.h" | 13 #include "ui/views/controls/button/button.h" |
11 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
12 | 15 |
13 namespace views { | 16 namespace views { |
14 class Widget; | 17 class Widget; |
15 } | 18 } |
16 | 19 |
17 namespace ash { | 20 namespace ash { |
18 class FrameCaptionButton; | 21 class FrameCaptionButton; |
19 class FrameMaximizeButton; | 22 class FrameMaximizeButton; |
20 | 23 |
21 // Container view for the frame caption buttons. It performs the appropriate | 24 // Container view for the frame caption buttons. It performs the appropriate |
22 // action when a caption button is clicked. | 25 // action when a caption button is clicked. |
23 class ASH_EXPORT FrameCaptionButtonContainerView | 26 class ASH_EXPORT FrameCaptionButtonContainerView |
24 : public views::View, | 27 : public views::View, |
25 public views::ButtonListener, | 28 public views::ButtonListener, |
26 public AlternateFrameSizeButtonDelegate { | 29 public AlternateFrameSizeButtonDelegate, |
30 ui::ImplicitAnimationObserver { | |
flackr
2014/05/08 19:02:21
public ui::ImplicitAnimationObserver
jonross
2014/05/08 21:15:40
Done.
| |
27 public: | 31 public: |
28 static const char kViewClassName[]; | 32 static const char kViewClassName[]; |
29 | 33 |
30 // Whether the frame can be minimized (either via the maximize/restore button | 34 // Whether the frame can be minimized (either via the maximize/restore button |
31 // or via a dedicated button). | 35 // or via a dedicated button). |
32 enum MinimizeAllowed { | 36 enum MinimizeAllowed { |
33 MINIMIZE_ALLOWED, | 37 MINIMIZE_ALLOWED, |
34 MINIMIZE_DISALLOWED | 38 MINIMIZE_DISALLOWED |
35 }; | 39 }; |
36 | 40 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 virtual void SetButtonsToNormal(Animate animate) OVERRIDE; | 139 virtual void SetButtonsToNormal(Animate animate) OVERRIDE; |
136 virtual void SetButtonIcons(CaptionButtonIcon minimize_button_icon, | 140 virtual void SetButtonIcons(CaptionButtonIcon minimize_button_icon, |
137 CaptionButtonIcon close_button_icon, | 141 CaptionButtonIcon close_button_icon, |
138 Animate animate) OVERRIDE; | 142 Animate animate) OVERRIDE; |
139 virtual const FrameCaptionButton* GetButtonClosestTo( | 143 virtual const FrameCaptionButton* GetButtonClosestTo( |
140 const gfx::Point& position_in_screen) const OVERRIDE; | 144 const gfx::Point& position_in_screen) const OVERRIDE; |
141 virtual void SetHoveredAndPressedButtons( | 145 virtual void SetHoveredAndPressedButtons( |
142 const FrameCaptionButton* to_hover, | 146 const FrameCaptionButton* to_hover, |
143 const FrameCaptionButton* to_press) OVERRIDE; | 147 const FrameCaptionButton* to_press) OVERRIDE; |
144 | 148 |
149 // ui::ImplicitAnimationObserver: | |
150 virtual void OnImplicitAnimationsCompleted() OVERRIDE; | |
151 | |
145 // The widget that the buttons act on. | 152 // The widget that the buttons act on. |
146 views::Widget* frame_; | 153 views::Widget* frame_; |
147 | 154 |
148 // The buttons. In the normal button style, at most one of |minimize_button_| | 155 // The buttons. In the normal button style, at most one of |minimize_button_| |
149 // and |size_button_| is visible. | 156 // and |size_button_| is visible. |
150 FrameCaptionButton* minimize_button_; | 157 FrameCaptionButton* minimize_button_; |
151 FrameCaptionButton* size_button_; | 158 FrameCaptionButton* size_button_; |
152 FrameCaptionButton* close_button_; | 159 FrameCaptionButton* close_button_; |
153 | 160 |
154 // Mapping of the images needed to paint a button for each of the values of | 161 // Mapping of the images needed to paint a button for each of the values of |
155 // CaptionButtonIcon. | 162 // CaptionButtonIcon. |
156 std::map<CaptionButtonIcon, ButtonIconIds> button_icon_id_map_; | 163 std::map<CaptionButtonIcon, ButtonIconIds> button_icon_id_map_; |
157 | 164 |
158 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); | 165 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); |
159 }; | 166 }; |
160 | 167 |
161 } // namesapace ash | 168 } // namespace ash |
162 | 169 |
163 #endif // ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ | 170 #endif // ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ |
OLD | NEW |