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 #include "ash/wm/workspace/frame_maximize_button.h" | 5 #include "ash/wm/workspace/frame_maximize_button.h" |
6 | 6 |
7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/property_util.h" | 10 #include "ash/wm/property_util.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 ImageButton::OnMouseReleased(event); | 239 ImageButton::OnMouseReleased(event); |
240 // At this point |this| might be already destroyed. | 240 // At this point |this| might be already destroyed. |
241 } | 241 } |
242 | 242 |
243 void FrameMaximizeButton::OnMouseCaptureLost() { | 243 void FrameMaximizeButton::OnMouseCaptureLost() { |
244 Cancel(false); | 244 Cancel(false); |
245 ImageButton::OnMouseCaptureLost(); | 245 ImageButton::OnMouseCaptureLost(); |
246 } | 246 } |
247 | 247 |
248 ui::GestureStatus FrameMaximizeButton::OnGestureEvent( | 248 ui::GestureStatus FrameMaximizeButton::OnGestureEvent( |
249 const views::GestureEvent& event) { | 249 const ui::GestureEvent& event) { |
250 if (event.type() == ui::ET_GESTURE_TAP_DOWN) { | 250 if (event.type() == ui::ET_GESTURE_TAP_DOWN) { |
251 is_snap_enabled_ = true; | 251 is_snap_enabled_ = true; |
252 ProcessStartEvent(event); | 252 ProcessStartEvent(event); |
253 return ui::GESTURE_STATUS_CONSUMED; | 253 return ui::GESTURE_STATUS_CONSUMED; |
254 } | 254 } |
255 | 255 |
256 if (event.type() == ui::ET_GESTURE_TAP || | 256 if (event.type() == ui::ET_GESTURE_TAP || |
257 event.type() == ui::ET_GESTURE_SCROLL_END) { | 257 event.type() == ui::ET_GESTURE_SCROLL_END) { |
258 if (event.type() == ui::ET_GESTURE_TAP) | 258 if (event.type() == ui::ET_GESTURE_TAP) |
259 snap_type_ = SnapTypeForLocation(event.location()); | 259 snap_type_ = SnapTypeForLocation(event.location()); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 break; | 490 break; |
491 case SNAP_RESTORE: | 491 case SNAP_RESTORE: |
492 frame_->GetWidget()->Restore(); | 492 frame_->GetWidget()->Restore(); |
493 break; | 493 break; |
494 case SNAP_NONE: | 494 case SNAP_NONE: |
495 NOTREACHED(); | 495 NOTREACHED(); |
496 } | 496 } |
497 } | 497 } |
498 | 498 |
499 } // namespace ash | 499 } // namespace ash |
OLD | NEW |