OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ | 5 #ifndef ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ |
6 #define ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ | 6 #define ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/wm/workspace/snap_types.h" | 9 #include "ash/wm/workspace/snap_types.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // ImageButton overrides: | 56 // ImageButton overrides: |
57 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 57 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
58 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 58 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; |
59 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 59 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; |
60 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 60 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; |
61 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 61 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
62 virtual void OnMouseCaptureLost() OVERRIDE; | 62 virtual void OnMouseCaptureLost() OVERRIDE; |
63 virtual ui::GestureStatus OnGestureEvent( | 63 virtual ui::GestureStatus OnGestureEvent( |
64 const views::GestureEvent& event) OVERRIDE; | 64 const views::GestureEvent& event) OVERRIDE; |
65 | 65 |
66 // Unit test overwrite: Change the UI delay used for the bubble show up. | |
67 void set_bubble_appearance_delay_ms(int bubble_appearance_delay_ms) { | |
68 bubble_appearance_delay_ms_ = bubble_appearance_delay_ms; | |
69 } | |
70 | |
71 // Unit test accessor for the maximize bubble. | |
72 MaximizeBubbleController* maximizer() { return maximizer_.get(); } | |
73 | |
74 // Unit test to see if phantom window is open. | |
75 bool phantom_window_open() { return phantom_window_.get() != NULL; } | |
76 | |
77 private: | 66 private: |
78 class EscapeEventFilter; | 67 class EscapeEventFilter; |
79 | 68 |
80 // Initializes the snap-gesture based on the event. This should only be called | 69 // Initializes the snap-gesture based on the event. This should only be called |
81 // when the event is confirmed to have started a snap gesture. | 70 // when the event is confirmed to have started a snap gesture. |
82 void ProcessStartEvent(const ui::LocatedEvent& event); | 71 void ProcessStartEvent(const ui::LocatedEvent& event); |
83 | 72 |
84 // Updates the snap-state based on the current event. This should only be | 73 // Updates the snap-state based on the current event. This should only be |
85 // called after the snap gesture has already started. | 74 // called after the snap gesture has already started. |
86 void ProcessUpdateEvent(const ui::LocatedEvent& event); | 75 void ProcessUpdateEvent(const ui::LocatedEvent& event); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 SnapType snap_type_; | 129 SnapType snap_type_; |
141 | 130 |
142 scoped_ptr<internal::SnapSizer> snap_sizer_; | 131 scoped_ptr<internal::SnapSizer> snap_sizer_; |
143 | 132 |
144 scoped_ptr<EscapeEventFilter> escape_event_filter_; | 133 scoped_ptr<EscapeEventFilter> escape_event_filter_; |
145 | 134 |
146 base::OneShotTimer<FrameMaximizeButton> update_timer_; | 135 base::OneShotTimer<FrameMaximizeButton> update_timer_; |
147 | 136 |
148 scoped_ptr<MaximizeBubbleController> maximizer_; | 137 scoped_ptr<MaximizeBubbleController> maximizer_; |
149 | 138 |
150 // The delay of the bubble appearance. | |
151 int bubble_appearance_delay_ms_; | |
152 | |
153 DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton); | 139 DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton); |
154 }; | 140 }; |
155 | 141 |
156 } // namespace ash | 142 } // namespace ash |
157 | 143 |
158 #endif // ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ | 144 #endif // ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ |
OLD | NEW |