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/apps_container_view.h" | 5 #include "ui/app_list/views/apps_container_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 return; | 94 return; |
95 | 95 |
96 PrepareToShowApps(folder_item); | 96 PrepareToShowApps(folder_item); |
97 SetShowState(SHOW_ITEM_REPARENT, false); | 97 SetShowState(SHOW_ITEM_REPARENT, false); |
98 } | 98 } |
99 | 99 |
100 bool AppsContainerView::IsInFolderView() const { | 100 bool AppsContainerView::IsInFolderView() const { |
101 return show_state_ == SHOW_ACTIVE_FOLDER; | 101 return show_state_ == SHOW_ACTIVE_FOLDER; |
102 } | 102 } |
103 | 103 |
104 gfx::Size AppsContainerView::GetPreferredSize() { | 104 gfx::Size AppsContainerView::GetPreferredSize() const { |
105 const gfx::Size grid_size = apps_grid_view_->GetPreferredSize(); | 105 const gfx::Size grid_size = apps_grid_view_->GetPreferredSize(); |
106 const gfx::Size folder_view_size = app_list_folder_view_->GetPreferredSize(); | 106 const gfx::Size folder_view_size = app_list_folder_view_->GetPreferredSize(); |
107 | 107 |
108 int width = std::max(grid_size.width(), folder_view_size.width()); | 108 int width = std::max(grid_size.width(), folder_view_size.width()); |
109 int height = std::max(grid_size.height(), folder_view_size.height()); | 109 int height = std::max(grid_size.height(), folder_view_size.height()); |
110 return gfx::Size(width, height); | 110 return gfx::Size(width, height); |
111 } | 111 } |
112 | 112 |
113 void AppsContainerView::Layout() { | 113 void AppsContainerView::Layout() { |
114 gfx::Rect rect(GetContentsBounds()); | 114 gfx::Rect rect(GetContentsBounds()); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { | 227 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { |
228 if (folder_item) | 228 if (folder_item) |
229 CreateViewsForFolderTopItemsAnimation(folder_item, false); | 229 CreateViewsForFolderTopItemsAnimation(folder_item, false); |
230 | 230 |
231 // Hide the active folder item until the animation completes. | 231 // Hide the active folder item until the animation completes. |
232 if (apps_grid_view_->activated_folder_item_view()) | 232 if (apps_grid_view_->activated_folder_item_view()) |
233 apps_grid_view_->activated_folder_item_view()->SetVisible(false); | 233 apps_grid_view_->activated_folder_item_view()->SetVisible(false); |
234 } | 234 } |
235 | 235 |
236 } // namespace app_list | 236 } // namespace app_list |
OLD | NEW |