| 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/workspace_cycler_animator.h" | 5 #include "ash/wm/workspace/workspace_cycler_animator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "ash/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
| 11 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
| 12 #include "ash/screen_ash.h" | 12 #include "ash/screen_ash.h" |
| 13 #include "ash/shelf/shelf_layout_manager.h" |
| 14 #include "ash/shelf/shelf_widget.h" |
| 13 #include "ash/shell_window_ids.h" | 15 #include "ash/shell_window_ids.h" |
| 14 #include "ash/wm/property_util.h" | 16 #include "ash/wm/property_util.h" |
| 15 #include "ash/wm/shelf_layout_manager.h" | |
| 16 #include "ash/wm/workspace/colored_window_controller.h" | 17 #include "ash/wm/workspace/colored_window_controller.h" |
| 17 #include "ash/wm/workspace/workspace.h" | 18 #include "ash/wm/workspace/workspace.h" |
| 18 #include "ash/wm/workspace/workspace_cycler_configuration.h" | 19 #include "ash/wm/workspace/workspace_cycler_configuration.h" |
| 19 #include "base/values.h" | 20 #include "base/values.h" |
| 20 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 21 #include "ui/base/events/event_utils.h" | 22 #include "ui/base/events/event_utils.h" |
| 22 #include "ui/compositor/layer_animator.h" | 23 #include "ui/compositor/layer_animator.h" |
| 23 #include "ui/compositor/scoped_layer_animation_settings.h" | 24 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 24 #include "ui/gfx/transform_util.h" | 25 #include "ui/gfx/transform_util.h" |
| 25 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 double change) const { | 648 double change) const { |
| 648 double ratio = Config::GetDouble( | 649 double ratio = Config::GetDouble( |
| 649 Config::CYCLER_STEP_ANIMATION_DURATION_RATIO); | 650 Config::CYCLER_STEP_ANIMATION_DURATION_RATIO); |
| 650 return static_cast<int>(fabs(change) * ratio); | 651 return static_cast<int>(fabs(change) * ratio); |
| 651 } | 652 } |
| 652 | 653 |
| 653 void WorkspaceCyclerAnimator::CreateLauncherBackground() { | 654 void WorkspaceCyclerAnimator::CreateLauncherBackground() { |
| 654 if (screen_bounds_ == maximized_bounds_) | 655 if (screen_bounds_ == maximized_bounds_) |
| 655 return; | 656 return; |
| 656 | 657 |
| 657 aura::Window* random_workspace_window = workspaces_[0]->window(); | 658 aura::Window* launcher_window = workspaces_[0]->window(); |
| 658 ash::Launcher* launcher = ash::Launcher::ForWindow(random_workspace_window); | |
| 659 aura::Window* launcher_window = launcher->widget()->GetNativeWindow(); | |
| 660 | 659 |
| 661 // TODO(pkotwicz): Figure out what to do when the launcher visible state is | 660 // TODO(pkotwicz): Figure out what to do when the launcher visible state is |
| 662 // SHELF_AUTO_HIDE. | 661 // SHELF_AUTO_HIDE. |
| 663 ShelfLayoutManager* shelf_layout_manager = | 662 ShelfLayoutManager* shelf_layout_manager = |
| 664 ShelfLayoutManager::ForLauncher(launcher_window); | 663 ShelfLayoutManager::ForLauncher(launcher_window); |
| 665 if (!shelf_layout_manager->IsVisible()) | 664 if (!shelf_layout_manager->IsVisible()) |
| 666 return; | 665 return; |
| 667 | 666 |
| 668 gfx::Rect shelf_bounds = shelf_layout_manager->GetIdealBounds(); | 667 gfx::Rect shelf_bounds = shelf_layout_manager->GetIdealBounds(); |
| 669 | 668 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 MessageLoopForUI::current()->PostTask( | 710 MessageLoopForUI::current()->PostTask( |
| 712 FROM_HERE, | 711 FROM_HERE, |
| 713 base::Bind(&WorkspaceCyclerAnimator::NotifyDelegate, | 712 base::Bind(&WorkspaceCyclerAnimator::NotifyDelegate, |
| 714 AsWeakPtr(), | 713 AsWeakPtr(), |
| 715 completed_animation)); | 714 completed_animation)); |
| 716 } | 715 } |
| 717 } | 716 } |
| 718 | 717 |
| 719 } // namespace internal | 718 } // namespace internal |
| 720 } // namespace ash | 719 } // namespace ash |
| OLD | NEW |