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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // works correctly. | 88 // works correctly. |
89 if (wm::IsWindowMaximized(target_) || | 89 if (wm::IsWindowMaximized(target_) || |
90 wm::IsWindowFullscreen(target_)) | 90 wm::IsWindowFullscreen(target_)) |
91 wm::RestoreWindow(target_); | 91 wm::RestoreWindow(target_); |
92 | 92 |
93 ui::ScopedLayerAnimationSettings settings( | 93 ui::ScopedLayerAnimationSettings settings( |
94 target_->layer()->GetAnimator()); | 94 target_->layer()->GetAnimator()); |
95 SnapSizer sizer(target_, | 95 SnapSizer sizer(target_, |
96 gfx::Point(), | 96 gfx::Point(), |
97 event.details().swipe_left() ? internal::SnapSizer::LEFT_EDGE : | 97 event.details().swipe_left() ? internal::SnapSizer::LEFT_EDGE : |
98 internal::SnapSizer::RIGHT_EDGE, | 98 internal::SnapSizer::RIGHT_EDGE); |
99 Shell::GetInstance()->GetGridSize()); | |
100 target_->SetBounds(sizer.GetSnapBounds(target_->bounds())); | 99 target_->SetBounds(sizer.GetSnapBounds(target_->bounds())); |
101 } else if (event.details().swipe_up()) { | 100 } else if (event.details().swipe_up()) { |
102 if (!wm::IsWindowMaximized(target_) && | 101 if (!wm::IsWindowMaximized(target_) && |
103 !wm::IsWindowFullscreen(target_)) | 102 !wm::IsWindowFullscreen(target_)) |
104 wm::MaximizeWindow(target_); | 103 wm::MaximizeWindow(target_); |
105 } else if (event.details().swipe_down()) { | 104 } else if (event.details().swipe_down()) { |
106 wm::MinimizeWindow(target_); | 105 wm::MinimizeWindow(target_); |
107 } else { | 106 } else { |
108 NOTREACHED() << "Swipe happened without a direction."; | 107 NOTREACHED() << "Swipe happened without a direction."; |
109 } | 108 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 phantom_state_ = PHANTOM_WINDOW_MINIMIZED; | 145 phantom_state_ = PHANTOM_WINDOW_MINIMIZED; |
147 return rect; | 146 return rect; |
148 } | 147 } |
149 | 148 |
150 phantom_state_ = PHANTOM_WINDOW_NORMAL; | 149 phantom_state_ = PHANTOM_WINDOW_NORMAL; |
151 return window->bounds(); | 150 return window->bounds(); |
152 } | 151 } |
153 | 152 |
154 } // namespace internal | 153 } // namespace internal |
155 } // namespace ash | 154 } // namespace ash |
OLD | NEW |