| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SIZE_BUTTON_H_ | 5 #ifndef ASH_FRAME_CAPTION_BUTTONS_FRAME_SIZE_BUTTON_H_ |
| 6 #define ASH_FRAME_CAPTION_BUTTONS_FRAME_SIZE_BUTTON_H_ | 6 #define ASH_FRAME_CAPTION_BUTTONS_FRAME_SIZE_BUTTON_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 void OnMouseReleased(const ui::MouseEvent& event) override; | 44 void OnMouseReleased(const ui::MouseEvent& event) override; |
| 45 void OnMouseCaptureLost() override; | 45 void OnMouseCaptureLost() override; |
| 46 void OnMouseMoved(const ui::MouseEvent& event) override; | 46 void OnMouseMoved(const ui::MouseEvent& event) override; |
| 47 void OnGestureEvent(ui::GestureEvent* event) override; | 47 void OnGestureEvent(ui::GestureEvent* event) override; |
| 48 | 48 |
| 49 void set_delay_to_set_buttons_to_snap_mode(int delay_ms) { | 49 void set_delay_to_set_buttons_to_snap_mode(int delay_ms) { |
| 50 set_buttons_to_snap_mode_delay_ms_ = delay_ms; | 50 set_buttons_to_snap_mode_delay_ms_ = delay_ms; |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 enum SnapType { | 54 enum SnapType { SNAP_LEFT, SNAP_RIGHT, SNAP_NONE }; |
| 55 SNAP_LEFT, | |
| 56 SNAP_RIGHT, | |
| 57 SNAP_NONE | |
| 58 }; | |
| 59 | 55 |
| 60 // Starts |set_buttons_to_snap_mode_timer_|. | 56 // Starts |set_buttons_to_snap_mode_timer_|. |
| 61 void StartSetButtonsToSnapModeTimer(const ui::LocatedEvent& event); | 57 void StartSetButtonsToSnapModeTimer(const ui::LocatedEvent& event); |
| 62 | 58 |
| 63 // Animates the buttons adjacent to the size button to snap left and right. | 59 // Animates the buttons adjacent to the size button to snap left and right. |
| 64 void AnimateButtonsToSnapMode(); | 60 void AnimateButtonsToSnapMode(); |
| 65 | 61 |
| 66 // Sets the buttons adjacent to the size button to snap left and right. | 62 // Sets the buttons adjacent to the size button to snap left and right. |
| 67 // Passing in ANIMATE_NO progresses the animation (if any) to the end. | 63 // Passing in ANIMATE_NO progresses the animation (if any) to the end. |
| 68 void SetButtonsToSnapMode(FrameSizeButtonDelegate::Animate animate); | 64 void SetButtonsToSnapMode(FrameSizeButtonDelegate::Animate animate); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // snapping the window left or right. The preview is only visible if the snap | 111 // snapping the window left or right. The preview is only visible if the snap |
| 116 // left or snap right button is pressed. | 112 // left or snap right button is pressed. |
| 117 std::unique_ptr<PhantomWindowController> phantom_window_controller_; | 113 std::unique_ptr<PhantomWindowController> phantom_window_controller_; |
| 118 | 114 |
| 119 DISALLOW_COPY_AND_ASSIGN(FrameSizeButton); | 115 DISALLOW_COPY_AND_ASSIGN(FrameSizeButton); |
| 120 }; | 116 }; |
| 121 | 117 |
| 122 } // namespace ash | 118 } // namespace ash |
| 123 | 119 |
| 124 #endif // ASH_FRAME_CAPTION_BUTTONS_FRAME_SIZE_BUTTON_H_ | 120 #endif // ASH_FRAME_CAPTION_BUTTONS_FRAME_SIZE_BUTTON_H_ |
| OLD | NEW |