| 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 enum class VectorIconId; | 19 struct VectorIcon; |
| 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, gfx::VectorIconId icon_image_id); | 71 void SetButtonImage(CaptionButtonIcon icon, |
| 72 const gfx::VectorIcon& icon_definition); |
| 72 | 73 |
| 73 // Sets whether the buttons should be painted as active. Does not schedule | 74 // Sets whether the buttons should be painted as active. Does not schedule |
| 74 // a repaint. | 75 // a repaint. |
| 75 void SetPaintAsActive(bool paint_as_active); | 76 void SetPaintAsActive(bool paint_as_active); |
| 76 | 77 |
| 77 // Sets whether the buttons should be painted in a lighter color (for use on | 78 // Sets whether the buttons should be painted in a lighter color (for use on |
| 78 // dark backgrounds). | 79 // dark backgrounds). |
| 79 void SetUseLightImages(bool light); | 80 void SetUseLightImages(bool light); |
| 80 | 81 |
| 81 // Tell the window controls to reset themselves to the normal state. | 82 // Tell the window controls to reset themselves to the normal state. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 135 |
| 135 // The widget that the buttons act on. | 136 // The widget that the buttons act on. |
| 136 views::Widget* frame_; | 137 views::Widget* frame_; |
| 137 | 138 |
| 138 // The buttons. In the normal button style, at most one of |minimize_button_| | 139 // The buttons. In the normal button style, at most one of |minimize_button_| |
| 139 // and |size_button_| is visible. | 140 // and |size_button_| is visible. |
| 140 FrameCaptionButton* minimize_button_; | 141 FrameCaptionButton* minimize_button_; |
| 141 FrameCaptionButton* size_button_; | 142 FrameCaptionButton* size_button_; |
| 142 FrameCaptionButton* close_button_; | 143 FrameCaptionButton* close_button_; |
| 143 | 144 |
| 144 // Mapping of the image ID needed to paint a button for each of the values of | 145 // Mapping of the image needed to paint a button for each of the values of |
| 145 // CaptionButtonIcon. | 146 // CaptionButtonIcon. |
| 146 std::map<CaptionButtonIcon, gfx::VectorIconId> button_icon_id_map_; | 147 std::map<CaptionButtonIcon, const gfx::VectorIcon*> button_icon_map_; |
| 147 | 148 |
| 148 // Animation that affects the position of |minimize_button_| and the | 149 // Animation that affects the position of |minimize_button_| and the |
| 149 // visibility of |size_button_|. | 150 // visibility of |size_button_|. |
| 150 std::unique_ptr<gfx::SlideAnimation> maximize_mode_animation_; | 151 std::unique_ptr<gfx::SlideAnimation> maximize_mode_animation_; |
| 151 | 152 |
| 152 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); | 153 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); |
| 153 }; | 154 }; |
| 154 | 155 |
| 155 } // namespace ash | 156 } // namespace ash |
| 156 | 157 |
| 157 #endif // ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_
H_ | 158 #endif // ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_
H_ |
| OLD | NEW |