| 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/accessibility/ax_node_data.h" | 9 #include "ui/accessibility/ax_node_data.h" |
| 10 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 UpdateFolderNameVisibility(true); | 104 UpdateFolderNameVisibility(true); |
| 105 | 105 |
| 106 ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator()); | 106 ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator()); |
| 107 animation.SetTweenType( | 107 animation.SetTweenType( |
| 108 show ? kFolderFadeInTweenType : kFolderFadeOutTweenType); | 108 show ? kFolderFadeInTweenType : kFolderFadeOutTweenType); |
| 109 animation.AddObserver(this); | 109 animation.AddObserver(this); |
| 110 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 110 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
| 111 show ? kFolderTransitionInDurationMs : kFolderTransitionOutDurationMs)); | 111 show ? kFolderTransitionInDurationMs : kFolderTransitionOutDurationMs)); |
| 112 | 112 |
| 113 layer()->SetOpacity(show ? 1.0f : 0.0f); | 113 layer()->SetOpacity(show ? 1.0f : 0.0f); |
| 114 app_list_main_view_->search_box_view()->ShowBackOrGoogleIcon(show); |
| 114 } | 115 } |
| 115 | 116 |
| 116 gfx::Size AppListFolderView::CalculatePreferredSize() const { | 117 gfx::Size AppListFolderView::CalculatePreferredSize() const { |
| 117 const gfx::Size header_size = folder_header_view_->GetPreferredSize(); | 118 const gfx::Size header_size = folder_header_view_->GetPreferredSize(); |
| 118 const gfx::Size grid_size = items_grid_view_->GetPreferredSize(); | 119 const gfx::Size grid_size = items_grid_view_->GetPreferredSize(); |
| 119 int width = std::max(header_size.width(), grid_size.width()); | 120 int width = std::max(header_size.width(), grid_size.width()); |
| 120 int height = header_size.height() + grid_size.height(); | 121 int height = header_size.height() + grid_size.height(); |
| 121 return gfx::Size(width, height); | 122 return gfx::Size(width, height); |
| 122 } | 123 } |
| 123 | 124 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 void AppListFolderView::GiveBackFocusToSearchBox() { | 344 void AppListFolderView::GiveBackFocusToSearchBox() { |
| 344 app_list_main_view_->search_box_view()->search_box()->RequestFocus(); | 345 app_list_main_view_->search_box_view()->search_box()->RequestFocus(); |
| 345 } | 346 } |
| 346 | 347 |
| 347 void AppListFolderView::SetItemName(AppListFolderItem* item, | 348 void AppListFolderView::SetItemName(AppListFolderItem* item, |
| 348 const std::string& name) { | 349 const std::string& name) { |
| 349 model_->SetItemName(item, name); | 350 model_->SetItemName(item, name); |
| 350 } | 351 } |
| 351 | 352 |
| 352 } // namespace app_list | 353 } // namespace app_list |
| OLD | NEW |