Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: ash/wm/workspace/workspace_cycler_animator.cc

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 double change) const { 654 double change) const {
654 double ratio = Config::GetDouble( 655 double ratio = Config::GetDouble(
655 Config::CYCLER_STEP_ANIMATION_DURATION_RATIO); 656 Config::CYCLER_STEP_ANIMATION_DURATION_RATIO);
656 return static_cast<int>(fabs(change) * ratio); 657 return static_cast<int>(fabs(change) * ratio);
657 } 658 }
658 659
659 void WorkspaceCyclerAnimator::CreateLauncherBackground() { 660 void WorkspaceCyclerAnimator::CreateLauncherBackground() {
660 if (screen_bounds_ == maximized_bounds_) 661 if (screen_bounds_ == maximized_bounds_)
661 return; 662 return;
662 663
663 aura::Window* random_workspace_window = workspaces_[0]->window(); 664 aura::Window* launcher_window = workspaces_[0]->window();
James Cook 2013/03/05 20:30:38 Are you sure this is right? The old code is lookin
Harry McCleave 2013/03/06 01:59:49 Done.
664 ash::Launcher* launcher = ash::Launcher::ForWindow(random_workspace_window);
665 aura::Window* launcher_window = launcher->widget()->GetNativeWindow();
666 665
667 // TODO(pkotwicz): Figure out what to do when the launcher visible state is 666 // TODO(pkotwicz): Figure out what to do when the launcher visible state is
668 // SHELF_AUTO_HIDE. 667 // SHELF_AUTO_HIDE.
669 ShelfLayoutManager* shelf_layout_manager = 668 ShelfLayoutManager* shelf_layout_manager =
670 ShelfLayoutManager::ForLauncher(launcher_window); 669 ShelfLayoutManager::ForLauncher(launcher_window);
671 if (!shelf_layout_manager->IsVisible()) 670 if (!shelf_layout_manager->IsVisible())
672 return; 671 return;
673 672
674 gfx::Rect shelf_bounds = shelf_layout_manager->GetIdealBounds(); 673 gfx::Rect shelf_bounds = shelf_layout_manager->GetIdealBounds();
675 674
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 MessageLoopForUI::current()->PostTask( 716 MessageLoopForUI::current()->PostTask(
718 FROM_HERE, 717 FROM_HERE,
719 base::Bind(&WorkspaceCyclerAnimator::NotifyDelegate, 718 base::Bind(&WorkspaceCyclerAnimator::NotifyDelegate,
720 AsWeakPtr(), 719 AsWeakPtr(),
721 completed_animation)); 720 completed_animation));
722 } 721 }
723 } 722 }
724 723
725 } // namespace internal 724 } // namespace internal
726 } // namespace ash 725 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698