| 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/gestures/system_pinch_handler.h" | 5 #include "ash/wm/gestures/system_pinch_handler.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 return SYSTEM_GESTURE_END; | 67 return SYSTEM_GESTURE_END; |
| 68 } | 68 } |
| 69 | 69 |
| 70 case ui::ET_GESTURE_PINCH_UPDATE: { | 70 case ui::ET_GESTURE_PINCH_UPDATE: { |
| 71 // The PINCH_UPDATE events contain incremental scaling updates. | 71 // The PINCH_UPDATE events contain incremental scaling updates. |
| 72 pinch_factor_ *= event.details().scale(); | 72 pinch_factor_ *= event.details().scale(); |
| 73 gfx::Rect bounds = | 73 gfx::Rect bounds = |
| 74 GetPhantomWindowScreenBounds(target_, event.location()); | 74 GetPhantomWindowScreenBounds(target_, event.location()); |
| 75 if (phantom_state_ != PHANTOM_WINDOW_NORMAL || phantom_.IsShowing()) | 75 if (phantom_state_ != PHANTOM_WINDOW_NORMAL || phantom_.IsShowing()) |
| 76 phantom_.Show(bounds, NULL); | 76 phantom_.Show(bounds); |
| 77 break; | 77 break; |
| 78 } | 78 } |
| 79 | 79 |
| 80 case ui::ET_GESTURE_MULTIFINGER_SWIPE: { | 80 case ui::ET_GESTURE_MULTIFINGER_SWIPE: { |
| 81 phantom_.Hide(); | 81 phantom_.Hide(); |
| 82 pinch_factor_ = 1.0; | 82 pinch_factor_ = 1.0; |
| 83 phantom_state_ = PHANTOM_WINDOW_NORMAL; | 83 phantom_state_ = PHANTOM_WINDOW_NORMAL; |
| 84 | 84 |
| 85 if (event.details().swipe_left() || event.details().swipe_right()) { | 85 if (event.details().swipe_left() || event.details().swipe_right()) { |
| 86 // Snap for left/right swipes. | 86 // Snap for left/right swipes. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 phantom_state_ = PHANTOM_WINDOW_MINIMIZED; | 137 phantom_state_ = PHANTOM_WINDOW_MINIMIZED; |
| 138 return rect; | 138 return rect; |
| 139 } | 139 } |
| 140 | 140 |
| 141 phantom_state_ = PHANTOM_WINDOW_NORMAL; | 141 phantom_state_ = PHANTOM_WINDOW_NORMAL; |
| 142 return window->bounds(); | 142 return window->bounds(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace internal | 145 } // namespace internal |
| 146 } // namespace ash | 146 } // namespace ash |
| OLD | NEW |