| 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 "grit/ui_strings.h" | 9 #include "grit/ui_strings.h" |
| 10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator()); | 110 ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator()); |
| 111 animation.SetTweenType( | 111 animation.SetTweenType( |
| 112 show ? kFolderFadeInTweenType : kFolderFadeOutTweenType); | 112 show ? kFolderFadeInTweenType : kFolderFadeOutTweenType); |
| 113 animation.AddObserver(this); | 113 animation.AddObserver(this); |
| 114 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 114 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
| 115 show ? kFolderTransitionInDurationMs : kFolderTransitionOutDurationMs)); | 115 show ? kFolderTransitionInDurationMs : kFolderTransitionOutDurationMs)); |
| 116 | 116 |
| 117 layer()->SetOpacity(show ? 1.0f : 0.0f); | 117 layer()->SetOpacity(show ? 1.0f : 0.0f); |
| 118 } | 118 } |
| 119 | 119 |
| 120 gfx::Size AppListFolderView::GetPreferredSize() { | 120 gfx::Size AppListFolderView::GetPreferredSize() const { |
| 121 const gfx::Size header_size = folder_header_view_->GetPreferredSize(); | 121 const gfx::Size header_size = folder_header_view_->GetPreferredSize(); |
| 122 const gfx::Size grid_size = items_grid_view_->GetPreferredSize(); | 122 const gfx::Size grid_size = items_grid_view_->GetPreferredSize(); |
| 123 int width = std::max(header_size.width(), grid_size.width()); | 123 int width = std::max(header_size.width(), grid_size.width()); |
| 124 int height = header_size.height() + grid_size.height(); | 124 int height = header_size.height() + grid_size.height(); |
| 125 return gfx::Size(width, height); | 125 return gfx::Size(width, height); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void AppListFolderView::Layout() { | 128 void AppListFolderView::Layout() { |
| 129 CalculateIdealBounds(); | 129 CalculateIdealBounds(); |
| 130 views::ViewModelUtils::SetViewBoundsToIdealBounds(*view_model_); | 130 views::ViewModelUtils::SetViewBoundsToIdealBounds(*view_model_); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 void AppListFolderView::GiveBackFocusToSearchBox() { | 320 void AppListFolderView::GiveBackFocusToSearchBox() { |
| 321 app_list_main_view_->search_box_view()->search_box()->RequestFocus(); | 321 app_list_main_view_->search_box_view()->search_box()->RequestFocus(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 void AppListFolderView::SetItemName(AppListFolderItem* item, | 324 void AppListFolderView::SetItemName(AppListFolderItem* item, |
| 325 const std::string& name) { | 325 const std::string& name) { |
| 326 model_->SetItemName(item, name); | 326 model_->SetItemName(item, name); |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace app_list | 329 } // namespace app_list |
| OLD | NEW |