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

Side by Side Diff: ui/app_list/views/app_list_folder_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/app_list_constants.cc ('k') | ui/app_list/views/apps_grid_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/app_list_folder_view.h" 5 #include "ui/app_list/views/app_list_folder_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ui/app_list/app_list_constants.h" 9 #include "ui/app_list/app_list_constants.h"
10 #include "ui/app_list/app_list_folder_item.h" 10 #include "ui/app_list/app_list_folder_item.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Hide the top items temporarily if showing the view for opening the folder. 92 // Hide the top items temporarily if showing the view for opening the folder.
93 if (show) 93 if (show)
94 items_grid_view_->SetTopItemViewsVisible(false); 94 items_grid_view_->SetTopItemViewsVisible(false);
95 95
96 // Set initial state. 96 // Set initial state.
97 layer()->SetOpacity(show ? 0.0f : 1.0f); 97 layer()->SetOpacity(show ? 0.0f : 1.0f);
98 SetVisible(true); 98 SetVisible(true);
99 UpdateFolderNameVisibility(true); 99 UpdateFolderNameVisibility(true);
100 100
101 ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator()); 101 ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator());
102 animation.SetTweenType(gfx::Tween::EASE_IN_2); 102 animation.SetTweenType(
103 show ? kFolderFadeInTweenType : kFolderFadeOutTweenType);
103 animation.AddObserver(this); 104 animation.AddObserver(this);
104 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( 105 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
105 show ? kFolderTransitionInDurationMs : kFolderTransitionOutDurationMs)); 106 show ? kFolderTransitionInDurationMs : kFolderTransitionOutDurationMs));
106 107
107 layer()->SetOpacity(show ? 1.0f : 0.0f); 108 layer()->SetOpacity(show ? 1.0f : 0.0f);
108 } 109 }
109 110
110 gfx::Size AppListFolderView::GetPreferredSize() { 111 gfx::Size AppListFolderView::GetPreferredSize() {
111 const gfx::Size header_size = folder_header_view_->GetPreferredSize(); 112 const gfx::Size header_size = folder_header_view_->GetPreferredSize();
112 const gfx::Size grid_size = items_grid_view_->GetPreferredSize(); 113 const gfx::Size grid_size = items_grid_view_->GetPreferredSize();
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 container_view_->apps_grid_view()-> 268 container_view_->apps_grid_view()->
268 EndDragFromReparentItemInRootLevel(events_forwarded_to_drag_drop_host); 269 EndDragFromReparentItemInRootLevel(events_forwarded_to_drag_drop_host);
269 } 270 }
270 271
271 void AppListFolderView::NavigateBack(AppListFolderItem* item, 272 void AppListFolderView::NavigateBack(AppListFolderItem* item,
272 const ui::Event& event_flags) { 273 const ui::Event& event_flags) {
273 container_view_->ShowApps(item); 274 container_view_->ShowApps(item);
274 } 275 }
275 276
276 } // namespace app_list 277 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/app_list_constants.cc ('k') | ui/app_list/views/apps_grid_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698