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

Side by Side Diff: ui/app_list/views/apps_grid_view.cc

Issue 162363002: Use the new animation tween type for app list folder animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « ui/app_list/views/app_list_folder_view.cc ('k') | ui/app_list/views/folder_background_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/app_list/views/apps_grid_view.h" 5 #include "ui/app_list/views/apps_grid_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 void AppsGridView::ScheduleShowHideAnimation(bool show) { 669 void AppsGridView::ScheduleShowHideAnimation(bool show) {
670 // Stop any previous animation. 670 // Stop any previous animation.
671 layer()->GetAnimator()->StopAnimating(); 671 layer()->GetAnimator()->StopAnimating();
672 672
673 // Set initial state. 673 // Set initial state.
674 SetVisible(true); 674 SetVisible(true);
675 layer()->SetOpacity(show ? 0.0f : 1.0f); 675 layer()->SetOpacity(show ? 0.0f : 1.0f);
676 676
677 ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator()); 677 ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator());
678 animation.AddObserver(this); 678 animation.AddObserver(this);
679 animation.SetTweenType(gfx::Tween::EASE_IN_2); 679 animation.SetTweenType(
680 show ? kFolderFadeInTweenType : kFolderFadeOutTweenType);
680 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( 681 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
681 show ? kFolderTransitionInDurationMs : kFolderTransitionOutDurationMs)); 682 show ? kFolderTransitionInDurationMs : kFolderTransitionOutDurationMs));
682 683
683 layer()->SetOpacity(show ? 1.0f : 0.0f); 684 layer()->SetOpacity(show ? 1.0f : 0.0f);
684 } 685 }
685 686
686 void AppsGridView::InitiateDragFromReparentItemInRootLevelGridView( 687 void AppsGridView::InitiateDragFromReparentItemInRootLevelGridView(
687 AppListItemView* original_drag_view, 688 AppListItemView* original_drag_view,
688 const gfx::Rect& drag_view_rect, 689 const gfx::Rect& drag_view_rect,
689 const gfx::Point& drag_point) { 690 const gfx::Point& drag_point) {
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
2045 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, 2046 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index,
2046 bool is_target_folder) { 2047 bool is_target_folder) {
2047 AppListItemView* target_view = 2048 AppListItemView* target_view =
2048 static_cast<AppListItemView*>( 2049 static_cast<AppListItemView*>(
2049 GetViewAtSlotOnCurrentPage(target_index.slot)); 2050 GetViewAtSlotOnCurrentPage(target_index.slot));
2050 if (target_view) 2051 if (target_view)
2051 target_view->SetAsAttemptedFolderTarget(is_target_folder); 2052 target_view->SetAsAttemptedFolderTarget(is_target_folder);
2052 } 2053 }
2053 2054
2054 } // namespace app_list 2055 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_folder_view.cc ('k') | ui/app_list/views/folder_background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698