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> |
| 9 |
8 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
9 #include "ash/frame/caption_buttons/frame_size_button_delegate.h" | 11 #include "ash/frame/caption_buttons/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 | 21 |
19 // Container view for the frame caption buttons. It performs the appropriate | 22 // Container view for the frame caption buttons. It performs the appropriate |
20 // action when a caption button is clicked. | 23 // action when a caption button is clicked. |
21 class ASH_EXPORT FrameCaptionButtonContainerView | 24 class ASH_EXPORT FrameCaptionButtonContainerView |
22 : public views::View, | 25 : public views::View, |
23 public views::ButtonListener, | 26 public views::ButtonListener, |
24 public FrameSizeButtonDelegate { | 27 public FrameSizeButtonDelegate, |
| 28 public ui::ImplicitAnimationObserver { |
25 public: | 29 public: |
26 static const char kViewClassName[]; | 30 static const char kViewClassName[]; |
27 | 31 |
28 // Whether the frame can be minimized (either via the maximize/restore button | 32 // Whether the frame can be minimized (either via the maximize/restore button |
29 // or via a dedicated button). | 33 // or via a dedicated button). |
30 enum MinimizeAllowed { | 34 enum MinimizeAllowed { |
31 MINIMIZE_ALLOWED, | 35 MINIMIZE_ALLOWED, |
32 MINIMIZE_DISALLOWED | 36 MINIMIZE_DISALLOWED |
33 }; | 37 }; |
34 | 38 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 virtual void SetButtonsToNormal(Animate animate) OVERRIDE; | 133 virtual void SetButtonsToNormal(Animate animate) OVERRIDE; |
130 virtual void SetButtonIcons(CaptionButtonIcon minimize_button_icon, | 134 virtual void SetButtonIcons(CaptionButtonIcon minimize_button_icon, |
131 CaptionButtonIcon close_button_icon, | 135 CaptionButtonIcon close_button_icon, |
132 Animate animate) OVERRIDE; | 136 Animate animate) OVERRIDE; |
133 virtual const FrameCaptionButton* GetButtonClosestTo( | 137 virtual const FrameCaptionButton* GetButtonClosestTo( |
134 const gfx::Point& position_in_screen) const OVERRIDE; | 138 const gfx::Point& position_in_screen) const OVERRIDE; |
135 virtual void SetHoveredAndPressedButtons( | 139 virtual void SetHoveredAndPressedButtons( |
136 const FrameCaptionButton* to_hover, | 140 const FrameCaptionButton* to_hover, |
137 const FrameCaptionButton* to_press) OVERRIDE; | 141 const FrameCaptionButton* to_press) OVERRIDE; |
138 | 142 |
| 143 // ui::ImplicitAnimationObserver: |
| 144 virtual void OnImplicitAnimationsCompleted() OVERRIDE; |
| 145 |
139 // The widget that the buttons act on. | 146 // The widget that the buttons act on. |
140 views::Widget* frame_; | 147 views::Widget* frame_; |
141 | 148 |
142 // The buttons. In the normal button style, at most one of |minimize_button_| | 149 // The buttons. In the normal button style, at most one of |minimize_button_| |
143 // and |size_button_| is visible. | 150 // and |size_button_| is visible. |
144 FrameCaptionButton* minimize_button_; | 151 FrameCaptionButton* minimize_button_; |
145 FrameCaptionButton* size_button_; | 152 FrameCaptionButton* size_button_; |
146 FrameCaptionButton* close_button_; | 153 FrameCaptionButton* close_button_; |
147 | 154 |
148 // Mapping of the images needed to paint a button for each of the values of | 155 // Mapping of the images needed to paint a button for each of the values of |
149 // CaptionButtonIcon. | 156 // CaptionButtonIcon. |
150 std::map<CaptionButtonIcon, ButtonIconIds> button_icon_id_map_; | 157 std::map<CaptionButtonIcon, ButtonIconIds> button_icon_id_map_; |
151 | 158 |
152 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); | 159 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); |
153 }; | 160 }; |
154 | 161 |
155 } // namesapace ash | 162 } // namespace ash |
156 | 163 |
157 #endif // ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ | 164 #endif // ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ |
OLD | NEW |