| 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/app_list_controller.h" | 5 #include "ash/wm/app_list_controller.h" |
| 6 | 6 |
| 7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 if (is_visible_) { | 198 if (is_visible_) { |
| 199 target_bounds = widget->GetWindowBoundsInScreen(); | 199 target_bounds = widget->GetWindowBoundsInScreen(); |
| 200 widget->SetBounds(OffsetTowardsShelf(target_bounds, widget)); | 200 widget->SetBounds(OffsetTowardsShelf(target_bounds, widget)); |
| 201 } else { | 201 } else { |
| 202 target_bounds = OffsetTowardsShelf(widget->GetWindowBoundsInScreen(), | 202 target_bounds = OffsetTowardsShelf(widget->GetWindowBoundsInScreen(), |
| 203 widget); | 203 widget); |
| 204 } | 204 } |
| 205 | 205 |
| 206 ui::ScopedLayerAnimationSettings animation(layer->GetAnimator()); | 206 ui::ScopedLayerAnimationSettings animation(layer->GetAnimator()); |
| 207 animation.SetTransitionDuration( | 207 animation.SetTransitionDuration( |
| 208 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); | 208 base::TimeDelta::FromMilliseconds( |
| 209 is_visible_ ? 0 : kAnimationDurationMs)); |
| 209 animation.AddObserver(this); | 210 animation.AddObserver(this); |
| 210 | 211 |
| 211 layer->SetOpacity(is_visible_ ? 1.0 : 0.0); | 212 layer->SetOpacity(is_visible_ ? 1.0 : 0.0); |
| 212 widget->SetBounds(target_bounds); | 213 widget->SetBounds(target_bounds); |
| 213 } | 214 } |
| 214 | 215 |
| 215 void AppListController::ProcessLocatedEvent(aura::Window* target, | 216 void AppListController::ProcessLocatedEvent(aura::Window* target, |
| 216 const ui::LocatedEvent& event) { | 217 const ui::LocatedEvent& event) { |
| 217 // If the event happened on a menu, then the event should not close the app | 218 // If the event happened on a menu, then the event should not close the app |
| 218 // list. | 219 // list. |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 should_snap_back_ = false; | 369 should_snap_back_ = false; |
| 369 ui::ScopedLayerAnimationSettings animation(GetLayer(widget)->GetAnimator()); | 370 ui::ScopedLayerAnimationSettings animation(GetLayer(widget)->GetAnimator()); |
| 370 animation.SetTransitionDuration( | 371 animation.SetTransitionDuration( |
| 371 base::TimeDelta::FromMilliseconds(kSnapBackAnimationDurationMs)); | 372 base::TimeDelta::FromMilliseconds(kSnapBackAnimationDurationMs)); |
| 372 widget->SetBounds(view_bounds_); | 373 widget->SetBounds(view_bounds_); |
| 373 } | 374 } |
| 374 } | 375 } |
| 375 | 376 |
| 376 } // namespace internal | 377 } // namespace internal |
| 377 } // namespace ash | 378 } // namespace ash |
| OLD | NEW |