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_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ | 5 #ifndef ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ |
6 #define ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ | 6 #define ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "ash/common/frame/caption_buttons/frame_size_button_delegate.h" | 11 #include "ash/common/frame/caption_buttons/frame_size_button_delegate.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "ui/gfx/animation/animation_delegate.h" | 13 #include "ui/gfx/animation/animation_delegate.h" |
14 #include "ui/views/controls/button/button.h" | 14 #include "ui/views/controls/button/button.h" |
15 #include "ui/views/view.h" | 15 #include "ui/views/view.h" |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 class SlideAnimation; | 18 class SlideAnimation; |
19 struct VectorIcon; | 19 enum class VectorIconId; |
20 } | 20 } |
21 | 21 |
22 namespace views { | 22 namespace views { |
23 class Widget; | 23 class Widget; |
24 } | 24 } |
25 | 25 |
26 namespace ash { | 26 namespace ash { |
27 | 27 |
28 // Container view for the frame caption buttons. It performs the appropriate | 28 // Container view for the frame caption buttons. It performs the appropriate |
29 // action when a caption button is clicked. | 29 // action when a caption button is clicked. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 private: | 62 private: |
63 FrameCaptionButtonContainerView* container_view_; | 63 FrameCaptionButtonContainerView* container_view_; |
64 | 64 |
65 DISALLOW_COPY_AND_ASSIGN(TestApi); | 65 DISALLOW_COPY_AND_ASSIGN(TestApi); |
66 }; | 66 }; |
67 | 67 |
68 // Sets the id of the vector image to paint the button for |icon|. The | 68 // Sets the id of the vector image to paint the button for |icon|. The |
69 // FrameCaptionButtonContainerView will keep track of the image to use for | 69 // FrameCaptionButtonContainerView will keep track of the image to use for |
70 // |icon| even if none of the buttons currently use |icon|. | 70 // |icon| even if none of the buttons currently use |icon|. |
71 void SetButtonImage(CaptionButtonIcon icon, | 71 void SetButtonImage(CaptionButtonIcon icon, gfx::VectorIconId icon_image_id); |
72 const gfx::VectorIcon& icon_definition); | |
73 | 72 |
74 // Sets whether the buttons should be painted as active. Does not schedule | 73 // Sets whether the buttons should be painted as active. Does not schedule |
75 // a repaint. | 74 // a repaint. |
76 void SetPaintAsActive(bool paint_as_active); | 75 void SetPaintAsActive(bool paint_as_active); |
77 | 76 |
78 // Sets whether the buttons should be painted in a lighter color (for use on | 77 // Sets whether the buttons should be painted in a lighter color (for use on |
79 // dark backgrounds). | 78 // dark backgrounds). |
80 void SetUseLightImages(bool light); | 79 void SetUseLightImages(bool light); |
81 | 80 |
82 // Tell the window controls to reset themselves to the normal state. | 81 // Tell the window controls to reset themselves to the normal state. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 134 |
136 // The widget that the buttons act on. | 135 // The widget that the buttons act on. |
137 views::Widget* frame_; | 136 views::Widget* frame_; |
138 | 137 |
139 // The buttons. In the normal button style, at most one of |minimize_button_| | 138 // The buttons. In the normal button style, at most one of |minimize_button_| |
140 // and |size_button_| is visible. | 139 // and |size_button_| is visible. |
141 FrameCaptionButton* minimize_button_; | 140 FrameCaptionButton* minimize_button_; |
142 FrameCaptionButton* size_button_; | 141 FrameCaptionButton* size_button_; |
143 FrameCaptionButton* close_button_; | 142 FrameCaptionButton* close_button_; |
144 | 143 |
145 // Mapping of the image needed to paint a button for each of the values of | 144 // Mapping of the image ID needed to paint a button for each of the values of |
146 // CaptionButtonIcon. | 145 // CaptionButtonIcon. |
147 std::map<CaptionButtonIcon, const gfx::VectorIcon*> button_icon_map_; | 146 std::map<CaptionButtonIcon, gfx::VectorIconId> button_icon_id_map_; |
148 | 147 |
149 // Animation that affects the position of |minimize_button_| and the | 148 // Animation that affects the position of |minimize_button_| and the |
150 // visibility of |size_button_|. | 149 // visibility of |size_button_|. |
151 std::unique_ptr<gfx::SlideAnimation> maximize_mode_animation_; | 150 std::unique_ptr<gfx::SlideAnimation> maximize_mode_animation_; |
152 | 151 |
153 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); | 152 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); |
154 }; | 153 }; |
155 | 154 |
156 } // namespace ash | 155 } // namespace ash |
157 | 156 |
158 #endif // ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_
H_ | 157 #endif // ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_
H_ |
OLD | NEW |