| 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_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_DELEGATE_H_ | 5 #ifndef ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_DELEGATE_H_ |
| 6 #define ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_DELEGATE_H_ | 6 #define ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/wm/caption_buttons/caption_button_types.h" | 9 #include "ash/wm/caption_buttons/caption_button_types.h" |
| 10 | 10 |
| 11 namespace gfx { | 11 namespace gfx { |
| 12 class Insets; | 12 class Insets; |
| 13 class Point; | 13 class Point; |
| 14 class Vector2d; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace ash { | 17 namespace ash { |
| 17 class FrameCaptionButton; | 18 class FrameCaptionButton; |
| 18 | 19 |
| 19 // Delegate interface for AlternateFrameSizeButton. | 20 // Delegate interface for AlternateFrameSizeButton. |
| 20 class ASH_EXPORT AlternateFrameSizeButtonDelegate { | 21 class ASH_EXPORT AlternateFrameSizeButtonDelegate { |
| 21 public: | 22 public: |
| 22 enum Animate { | 23 enum Animate { |
| 23 ANIMATE_YES, | 24 ANIMATE_YES, |
| 24 ANIMATE_NO | 25 ANIMATE_NO |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 // Returns whether the minimize button is visible. | 28 // Returns whether the minimize button is visible. |
| 28 virtual bool IsMinimizeButtonVisible() const = 0; | 29 virtual bool IsMinimizeButtonVisible() const = 0; |
| 29 | 30 |
| 30 // Reset the caption button views::Button::ButtonState back to normal. If | 31 // Reset the caption button views::Button::ButtonState back to normal. If |
| 31 // |animate| is ANIMATE_YES, the buttons will crossfade back to their | 32 // |animate| is ANIMATE_YES, the buttons will crossfade back to their |
| 32 // original icons. | 33 // original icons. |
| 33 virtual void SetButtonsToNormal(Animate animate) = 0; | 34 virtual void SetButtonsToNormal(Animate animate) = 0; |
| 34 | 35 |
| 35 // Sets the minimize and close button icons. The buttons will crossfade to | 36 // Sets the minimize and close button icons. The buttons will crossfade to |
| 36 // their new icons if |animate| is ANIMATE_YES. | 37 // their new icons if |animate| is ANIMATE_YES. |
| 37 virtual void SetButtonIcons(CaptionButtonIcon left_button_action, | 38 virtual void SetButtonIcons(CaptionButtonIcon left_button_action, |
| 38 CaptionButtonIcon right_button_action, | 39 CaptionButtonIcon right_button_action, |
| 39 Animate animate) = 0; | 40 Animate animate) = 0; |
| 40 | 41 |
| 41 // Presses the button at |position_in_screen| and unpresses any other pressed | 42 // Returns the button closest to |position_in_screen|. |
| 42 // caption buttons. | 43 virtual const FrameCaptionButton* GetButtonClosestTo( |
| 43 // |pressed_button_hittest_insets| indicates how much the hittest insets for | 44 const gfx::Point& position_in_screen) const = 0; |
| 44 // the currently pressed button should be expanded if no button was found at | 45 |
| 45 // |position_in_screen| using the normal button hittest insets. | 46 // Sets |to_hover| and |to_pressed| to STATE_HOVERED and STATE_PRESSED |
| 46 // Returns the button which was pressed. | 47 // respectively. All other buttons are to set to STATE_NORMAL. |
| 47 virtual const FrameCaptionButton* PressButtonAt( | 48 virtual void SetHoveredAndPressedButtons( |
| 48 const gfx::Point& position_in_screen, | 49 const FrameCaptionButton* to_hover, |
| 49 const gfx::Insets& pressed_button_hittest_insets) const = 0; | 50 const FrameCaptionButton* to_press) = 0; |
| 50 | 51 |
| 51 protected: | 52 protected: |
| 52 virtual ~AlternateFrameSizeButtonDelegate() {} | 53 virtual ~AlternateFrameSizeButtonDelegate() {} |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 } // namespace ash | 56 } // namespace ash |
| 56 | 57 |
| 57 #endif // ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_DELEGATE_H_ | 58 #endif // ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_DELEGATE_H_ |
| OLD | NEW |