OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/contents_view.h" | 5 #include "ui/app_list/views/contents_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 void ContentsView::ShowFolderContent(AppListFolderItem* item) { | 203 void ContentsView::ShowFolderContent(AppListFolderItem* item) { |
204 apps_container_view_->ShowActiveFolder(item); | 204 apps_container_view_->ShowActiveFolder(item); |
205 } | 205 } |
206 | 206 |
207 void ContentsView::Prerender() { | 207 void ContentsView::Prerender() { |
208 const int selected_page = std::max(0, pagination_model_->selected_page()); | 208 const int selected_page = std::max(0, pagination_model_->selected_page()); |
209 apps_container_view_->apps_grid_view()->Prerender(selected_page); | 209 apps_container_view_->apps_grid_view()->Prerender(selected_page); |
210 } | 210 } |
211 | 211 |
212 gfx::Size ContentsView::GetPreferredSize() { | 212 gfx::Size ContentsView::GetPreferredSize() const { |
213 const gfx::Size container_size = GetAppsContainerView(view_model_.get())-> | 213 const gfx::Size container_size = GetAppsContainerView(view_model_.get())-> |
214 apps_grid_view()->GetPreferredSize(); | 214 apps_grid_view()->GetPreferredSize(); |
215 const gfx::Size results_size = | 215 const gfx::Size results_size = |
216 GetSearchResultListView(view_model_.get())->GetPreferredSize(); | 216 GetSearchResultListView(view_model_.get())->GetPreferredSize(); |
217 | 217 |
218 int width = std::max(container_size.width(), results_size.width()); | 218 int width = std::max(container_size.width(), results_size.width()); |
219 int height = std::max(container_size.height(), results_size.height()); | 219 int height = std::max(container_size.height(), results_size.height()); |
220 return gfx::Size(width, height); | 220 return gfx::Size(width, height); |
221 } | 221 } |
222 | 222 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 if (!pagination_model_->has_transition()) { | 312 if (!pagination_model_->has_transition()) { |
313 pagination_model_->SelectPageRelative(offset > 0 ? -1 : 1, | 313 pagination_model_->SelectPageRelative(offset > 0 ? -1 : 1, |
314 true); | 314 true); |
315 } | 315 } |
316 event->SetHandled(); | 316 event->SetHandled(); |
317 event->StopPropagation(); | 317 event->StopPropagation(); |
318 } | 318 } |
319 } | 319 } |
320 | 320 |
321 } // namespace app_list | 321 } // namespace app_list |
OLD | NEW |