| 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/shelf/shelf_widget.h" | 9 #include "ash/shelf/shelf_widget.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/shell_delegate.h" | 11 #include "ash/shell_delegate.h" |
| 12 #include "ash/touch/touch_uma.h" |
| 12 #include "ash/wm/maximize_bubble_controller.h" | 13 #include "ash/wm/maximize_bubble_controller.h" |
| 13 #include "ash/wm/property_util.h" | 14 #include "ash/wm/property_util.h" |
| 14 #include "ash/wm/window_properties.h" | 15 #include "ash/wm/window_properties.h" |
| 15 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
| 16 #include "ash/wm/workspace/phantom_window_controller.h" | 17 #include "ash/wm/workspace/phantom_window_controller.h" |
| 17 #include "ash/wm/workspace/snap_sizer.h" | 18 #include "ash/wm/workspace/snap_sizer.h" |
| 18 #include "grit/ash_strings.h" | 19 #include "grit/ash_strings.h" |
| 19 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
| 20 #include "ui/base/events/event.h" | 21 #include "ui/base/events/event.h" |
| 21 #include "ui/base/events/event_handler.h" | 22 #include "ui/base/events/event_handler.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 return; | 273 return; |
| 273 } | 274 } |
| 274 | 275 |
| 275 if (event->type() == ui::ET_GESTURE_TAP || | 276 if (event->type() == ui::ET_GESTURE_TAP || |
| 276 (event->type() == ui::ET_GESTURE_SCROLL_END && is_snap_enabled_) || | 277 (event->type() == ui::ET_GESTURE_SCROLL_END && is_snap_enabled_) || |
| 277 event->type() == ui::ET_SCROLL_FLING_START) { | 278 event->type() == ui::ET_SCROLL_FLING_START) { |
| 278 // The position of the event may have changed from the previous event (both | 279 // The position of the event may have changed from the previous event (both |
| 279 // for TAP and SCROLL_END). So it is necessary to update the snap-state for | 280 // for TAP and SCROLL_END). So it is necessary to update the snap-state for |
| 280 // the current event. | 281 // the current event. |
| 281 ProcessUpdateEvent(*event); | 282 ProcessUpdateEvent(*event); |
| 282 if (event->type() == ui::ET_GESTURE_TAP) | 283 if (event->type() == ui::ET_GESTURE_TAP) { |
| 283 snap_type_ = SnapTypeForLocation(event->location()); | 284 snap_type_ = SnapTypeForLocation(event->location()); |
| 285 TouchUMA::GetInstance()->RecordGestureAction( |
| 286 TouchUMA::GESTURE_FRAMEMAXIMIZE_TAP); |
| 287 } |
| 284 ProcessEndEvent(*event); | 288 ProcessEndEvent(*event); |
| 285 event->SetHandled(); | 289 event->SetHandled(); |
| 286 return; | 290 return; |
| 287 } | 291 } |
| 288 | 292 |
| 289 if (is_snap_enabled_) { | 293 if (is_snap_enabled_) { |
| 290 if (event->type() == ui::ET_GESTURE_END && | 294 if (event->type() == ui::ET_GESTURE_END && |
| 291 event->details().touch_points() == 1) { | 295 event->details().touch_points() == 1) { |
| 292 // The position of the event may have changed from the previous event. So | 296 // The position of the event may have changed from the previous event. So |
| 293 // it is necessary to update the snap-state for the current event. | 297 // it is necessary to update the snap-state for the current event. |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 return FRAME_STATE_SNAP_LEFT; | 615 return FRAME_STATE_SNAP_LEFT; |
| 612 if (bounds.right() == screen.right()) | 616 if (bounds.right() == screen.right()) |
| 613 return FRAME_STATE_SNAP_RIGHT; | 617 return FRAME_STATE_SNAP_RIGHT; |
| 614 // If we come here, it is likely caused by the fact that the | 618 // If we come here, it is likely caused by the fact that the |
| 615 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case | 619 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case |
| 616 // we allow all maximize operations (and keep the restore rectangle). | 620 // we allow all maximize operations (and keep the restore rectangle). |
| 617 return FRAME_STATE_NONE; | 621 return FRAME_STATE_NONE; |
| 618 } | 622 } |
| 619 | 623 |
| 620 } // namespace ash | 624 } // namespace ash |
| OLD | NEW |