OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |