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