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