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