OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/start_page_view.h" | 5 #include "ui/app_list/views/start_page_view.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "ui/app_list/app_list_constants.h" | 8 #include "ui/app_list/app_list_constants.h" |
9 #include "ui/app_list/app_list_item.h" | 9 #include "ui/app_list/app_list_item.h" |
10 #include "ui/app_list/app_list_model.h" | 10 #include "ui/app_list/app_list_model.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 // Add SearchResultTileItemViews to the container. | 138 // Add SearchResultTileItemViews to the container. |
139 for (size_t i = 0; i < std::max(kNumStartPageTiles, kNumSearchResultTiles); | 139 for (size_t i = 0; i < std::max(kNumStartPageTiles, kNumSearchResultTiles); |
140 ++i) { | 140 ++i) { |
141 SearchResultTileItemView* tile_item = new SearchResultTileItemView(); | 141 SearchResultTileItemView* tile_item = new SearchResultTileItemView(); |
142 tiles_container_->AddChildView(tile_item); | 142 tiles_container_->AddChildView(tile_item); |
143 search_result_tile_views_.push_back(tile_item); | 143 search_result_tile_views_.push_back(tile_item); |
144 } | 144 } |
145 | 145 |
146 // Also add a special "all apps" button to the end of the container. | 146 // Also add a special "all apps" button to the end of the container. |
147 all_apps_button_ = | 147 all_apps_button_ = new AllAppsTileItemView( |
148 new AllAppsTileItemView(app_list_main_view_->contents_view()); | 148 app_list_main_view_->contents_view(), |
| 149 view_delegate_->GetModel()->top_level_item_list()); |
| 150 all_apps_button_->UpdateIcon(); |
149 tiles_container_->AddChildView(all_apps_button_); | 151 tiles_container_->AddChildView(all_apps_button_); |
150 } | 152 } |
151 | 153 |
152 void StartPageView::SetModel(AppListModel* model) { | 154 void StartPageView::SetModel(AppListModel* model) { |
153 DCHECK(model); | 155 DCHECK(model); |
154 if (search_results_model_) | 156 if (search_results_model_) |
155 search_results_model_->RemoveObserver(this); | 157 search_results_model_->RemoveObserver(this); |
156 search_results_model_ = model->results(); | 158 search_results_model_ = model->results(); |
157 search_results_model_->AddObserver(this); | 159 search_results_model_->AddObserver(this); |
158 results_view_->SetResults(search_results_model_); | 160 results_view_->SetResults(search_results_model_); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 276 |
275 void StartPageView::ListItemMoved(size_t index, size_t target_index) { | 277 void StartPageView::ListItemMoved(size_t index, size_t target_index) { |
276 ScheduleUpdate(); | 278 ScheduleUpdate(); |
277 } | 279 } |
278 | 280 |
279 void StartPageView::ListItemsChanged(size_t start, size_t count) { | 281 void StartPageView::ListItemsChanged(size_t start, size_t count) { |
280 ScheduleUpdate(); | 282 ScheduleUpdate(); |
281 } | 283 } |
282 | 284 |
283 } // namespace app_list | 285 } // namespace app_list |
OLD | NEW |