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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 if (pinch_factor_ < kPinchThresholdForMinimize) { | 129 if (pinch_factor_ < kPinchThresholdForMinimize) { |
130 if (wm::IsWindowMaximized(window) || wm::IsWindowFullscreen(window)) { | 130 if (wm::IsWindowMaximized(window) || wm::IsWindowFullscreen(window)) { |
131 const gfx::Rect* restore = GetRestoreBoundsInScreen(window); | 131 const gfx::Rect* restore = GetRestoreBoundsInScreen(window); |
132 if (restore) { | 132 if (restore) { |
133 phantom_state_ = PHANTOM_WINDOW_MINIMIZED; | 133 phantom_state_ = PHANTOM_WINDOW_MINIMIZED; |
134 return *restore; | 134 return *restore; |
135 } | 135 } |
136 return window->bounds(); | 136 return window->bounds(); |
137 } | 137 } |
138 | 138 |
139 Launcher* launcher = Shell::GetInstance()->launcher(); | 139 Launcher* launcher = Launcher::ForWindow(window); |
140 gfx::Rect rect = launcher->GetScreenBoundsOfItemIconForWindow(target_); | 140 gfx::Rect rect = launcher->GetScreenBoundsOfItemIconForWindow(target_); |
141 if (rect.IsEmpty()) | 141 if (rect.IsEmpty()) |
142 rect = launcher->widget()->GetWindowBoundsInScreen(); | 142 rect = launcher->widget()->GetWindowBoundsInScreen(); |
143 else | 143 else |
144 rect.Inset(-8, -8); | 144 rect.Inset(-8, -8); |
145 phantom_state_ = PHANTOM_WINDOW_MINIMIZED; | 145 phantom_state_ = PHANTOM_WINDOW_MINIMIZED; |
146 return rect; | 146 return rect; |
147 } | 147 } |
148 | 148 |
149 phantom_state_ = PHANTOM_WINDOW_NORMAL; | 149 phantom_state_ = PHANTOM_WINDOW_NORMAL; |
150 return window->bounds(); | 150 return window->bounds(); |
151 } | 151 } |
152 | 152 |
153 } // namespace internal | 153 } // namespace internal |
154 } // namespace ash | 154 } // namespace ash |
OLD | NEW |