| 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_ALTERNATE_FRAME_SIZE_BUTTON_H_ | 5 #ifndef ASH_FRAME_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_ |
| 6 #define ASH_FRAME_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_ | 6 #define ASH_FRAME_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/frame/caption_buttons/alternate_frame_size_button_delegate.h" | 9 #include "ash/frame/caption_buttons/alternate_frame_size_button_delegate.h" |
| 10 #include "ash/frame/caption_buttons/frame_caption_button.h" | 10 #include "ash/frame/caption_buttons/frame_caption_button.h" |
| 11 #include "ash/wm/workspace/snap_types.h" | |
| 12 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
| 13 | 12 |
| 14 namespace views { | 13 namespace views { |
| 15 class Widget; | 14 class Widget; |
| 16 } | 15 } |
| 17 | 16 |
| 18 namespace ash { | 17 namespace ash { |
| 19 class AlternateFrameSizeButtonDelegate; | 18 class AlternateFrameSizeButtonDelegate; |
| 20 class PhantomWindowController; | 19 class PhantomWindowController; |
| 21 | 20 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 41 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
| 43 virtual void OnMouseCaptureLost() OVERRIDE; | 42 virtual void OnMouseCaptureLost() OVERRIDE; |
| 44 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; | 43 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; |
| 45 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 44 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; |
| 46 | 45 |
| 47 void set_delay_to_set_buttons_to_snap_mode(int delay_ms) { | 46 void set_delay_to_set_buttons_to_snap_mode(int delay_ms) { |
| 48 set_buttons_to_snap_mode_delay_ms_ = delay_ms; | 47 set_buttons_to_snap_mode_delay_ms_ = delay_ms; |
| 49 } | 48 } |
| 50 | 49 |
| 51 private: | 50 private: |
| 51 enum SnapType { |
| 52 SNAP_LEFT, |
| 53 SNAP_RIGHT, |
| 54 SNAP_NONE |
| 55 }; |
| 56 |
| 52 // Starts |set_buttons_to_snap_mode_timer_|. | 57 // Starts |set_buttons_to_snap_mode_timer_|. |
| 53 void StartSetButtonsToSnapModeTimer(const ui::LocatedEvent& event); | 58 void StartSetButtonsToSnapModeTimer(const ui::LocatedEvent& event); |
| 54 | 59 |
| 55 // Animates the buttons adjacent to the size button to snap left and right. | 60 // Animates the buttons adjacent to the size button to snap left and right. |
| 56 void AnimateButtonsToSnapMode(); | 61 void AnimateButtonsToSnapMode(); |
| 57 | 62 |
| 58 // Sets the buttons adjacent to the size button to snap left and right. | 63 // Sets the buttons adjacent to the size button to snap left and right. |
| 59 // Passing in ANIMATE_NO progresses the animation (if any) to the end. | 64 // Passing in ANIMATE_NO progresses the animation (if any) to the end. |
| 60 void SetButtonsToSnapMode( | 65 void SetButtonsToSnapMode( |
| 61 AlternateFrameSizeButtonDelegate::Animate animate); | 66 AlternateFrameSizeButtonDelegate::Animate animate); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // snapping the window left or right. The preview is only visible if the snap | 114 // snapping the window left or right. The preview is only visible if the snap |
| 110 // left or snap right button is pressed. | 115 // left or snap right button is pressed. |
| 111 scoped_ptr<PhantomWindowController> phantom_window_controller_; | 116 scoped_ptr<PhantomWindowController> phantom_window_controller_; |
| 112 | 117 |
| 113 DISALLOW_COPY_AND_ASSIGN(AlternateFrameSizeButton); | 118 DISALLOW_COPY_AND_ASSIGN(AlternateFrameSizeButton); |
| 114 }; | 119 }; |
| 115 | 120 |
| 116 } // namespace ash | 121 } // namespace ash |
| 117 | 122 |
| 118 #endif // ASH_FRAME_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_ | 123 #endif // ASH_FRAME_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_ |
| OLD | NEW |