Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Unified Diff: ui/app_list/views/contents_view.cc

Issue 22354002: Remove SetModel in ContentsView and SearchBoxView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove AppListModel stuff from SearchBoxView Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/views/contents_view.h ('k') | ui/app_list/views/search_box_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/contents_view.cc
diff --git a/ui/app_list/views/contents_view.cc b/ui/app_list/views/contents_view.cc
index 5167b89b5df179a8be7d852afbe619146482c6a7..5211eb1e6d7ea42d3c63f97726a5081d2582183b 100644
--- a/ui/app_list/views/contents_view.cc
+++ b/ui/app_list/views/contents_view.cc
@@ -46,11 +46,13 @@ SearchResultListView* GetSearchResultListView(views::ViewModel* model) {
} // namespace
ContentsView::ContentsView(AppListMainView* app_list_main_view,
- PaginationModel* pagination_model)
+ PaginationModel* pagination_model,
+ AppListModel* model)
: show_state_(SHOW_APPS),
pagination_model_(pagination_model),
view_model_(new views::ViewModel),
bounds_animator_(new views::BoundsAnimator(this)) {
+ DCHECK(model);
pagination_model_->SetTransitionDurations(
kPageTransitionDurationInMs,
kOverscrollPageTransitionDurationMs);
@@ -66,19 +68,12 @@ ContentsView::ContentsView(AppListMainView* app_list_main_view,
app_list_main_view);
AddChildView(search_results_view);
view_model_->Add(search_results_view, kIndexSearchResults);
-}
-ContentsView::~ContentsView() {
+ GetAppsGridView(view_model_.get())->SetModel(model);
+ GetSearchResultListView(view_model_.get())->SetResults(model->results());
}
-void ContentsView::SetModel(AppListModel* model) {
- if (model) {
- GetAppsGridView(view_model_.get())->SetModel(model);
- GetSearchResultListView(view_model_.get())->SetResults(model->results());
- } else {
- GetAppsGridView(view_model_.get())->SetModel(NULL);
- GetSearchResultListView(view_model_.get())->SetResults(NULL);
- }
+ContentsView::~ContentsView() {
}
void ContentsView::SetDragAndDropHostOfCurrentAppList(
« no previous file with comments | « ui/app_list/views/contents_view.h ('k') | ui/app_list/views/search_box_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698