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/contents_view.h" | 5 #include "ui/app_list/contents_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/app_list/app_list_view.h" | 9 #include "ui/app_list/app_list_view.h" |
10 #include "ui/app_list/apps_grid_view.h" | 10 #include "ui/app_list/apps_grid_view.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 app_list_view); | 67 app_list_view); |
68 AddChildView(search_results_view); | 68 AddChildView(search_results_view); |
69 view_model_->Add(search_results_view, kIndexSearchResults); | 69 view_model_->Add(search_results_view, kIndexSearchResults); |
70 } | 70 } |
71 | 71 |
72 ContentsView::~ContentsView() { | 72 ContentsView::~ContentsView() { |
73 } | 73 } |
74 | 74 |
75 void ContentsView::SetModel(AppListModel* model) { | 75 void ContentsView::SetModel(AppListModel* model) { |
76 if (model) { | 76 if (model) { |
77 GetAppsGridView(view_model_.get())->SetModel(model->apps()); | 77 GetAppsGridView(view_model_.get())->SetModel(model); |
78 GetSearchResultListView(view_model_.get())->SetResults(model->results()); | 78 GetSearchResultListView(view_model_.get())->SetResults(model->results()); |
79 } else { | 79 } else { |
80 GetAppsGridView(view_model_.get())->SetModel(NULL); | 80 GetAppsGridView(view_model_.get())->SetModel(NULL); |
81 GetSearchResultListView(view_model_.get())->SetResults(NULL); | 81 GetSearchResultListView(view_model_.get())->SetResults(NULL); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 void ContentsView::SetShowState(ShowState show_state) { | 85 void ContentsView::SetShowState(ShowState show_state) { |
86 if (show_state_ == show_state) | 86 if (show_state_ == show_state) |
87 return; | 87 return; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 pagination_model_->SelectPageRelative(event->x_offset() > 0 ? -1 : 1, | 226 pagination_model_->SelectPageRelative(event->x_offset() > 0 ? -1 : 1, |
227 true); | 227 true); |
228 } | 228 } |
229 return ui::ER_HANDLED; | 229 return ui::ER_HANDLED; |
230 } | 230 } |
231 | 231 |
232 return ui::ER_UNHANDLED; | 232 return ui::ER_UNHANDLED; |
233 } | 233 } |
234 | 234 |
235 } // namespace app_list | 235 } // namespace app_list |
OLD | NEW |