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/app_list_main_view.h" | 5 #include "ui/app_list/views/app_list_main_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // Switch the apps grid view to the specified page. | 102 // Switch the apps grid view to the specified page. |
103 app_list::PaginationModel* pagination_model = GetAppsPaginationModel(); | 103 app_list::PaginationModel* pagination_model = GetAppsPaginationModel(); |
104 if (pagination_model->is_valid_page(initial_apps_page)) | 104 if (pagination_model->is_valid_page(initial_apps_page)) |
105 pagination_model->SelectPage(initial_apps_page, false); | 105 pagination_model->SelectPage(initial_apps_page, false); |
106 | 106 |
107 // Starts icon loading early. | 107 // Starts icon loading early. |
108 PreloadIcons(parent); | 108 PreloadIcons(parent); |
109 } | 109 } |
110 | 110 |
111 void AppListMainView::AddContentsViews() { | 111 void AppListMainView::AddContentsViews() { |
112 contents_view_ = new ContentsView(this, model_, delegate_); | 112 contents_view_ = new ContentsView(this); |
113 AddChildView(contents_view_); | |
114 if (app_list::switches::IsExperimentalAppListEnabled()) { | 113 if (app_list::switches::IsExperimentalAppListEnabled()) { |
115 contents_switcher_view_ = new ContentsSwitcherView(contents_view_); | 114 contents_switcher_view_ = new ContentsSwitcherView(contents_view_); |
| 115 contents_view_->set_contents_switcher_view(contents_switcher_view_); |
| 116 } |
| 117 contents_view_->InitNamedPages(model_, delegate_); |
| 118 AddChildView(contents_view_); |
| 119 if (contents_switcher_view_) |
116 AddChildView(contents_switcher_view_); | 120 AddChildView(contents_switcher_view_); |
117 } | |
118 | 121 |
119 search_box_view_->set_contents_view(contents_view_); | 122 search_box_view_->set_contents_view(contents_view_); |
120 | 123 |
121 contents_view_->SetPaintToLayer(true); | 124 contents_view_->SetPaintToLayer(true); |
122 contents_view_->SetFillsBoundsOpaquely(false); | 125 contents_view_->SetFillsBoundsOpaquely(false); |
123 contents_view_->layer()->SetMasksToBounds(true); | 126 contents_view_->layer()->SetMasksToBounds(true); |
124 } | 127 } |
125 | 128 |
126 AppListMainView::~AppListMainView() { | 129 AppListMainView::~AppListMainView() { |
127 pending_icon_loaders_.clear(); | 130 pending_icon_loaders_.clear(); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // Resubmit the query via a posted task so that all observers for the | 293 // Resubmit the query via a posted task so that all observers for the |
291 // uninstall notification are notified. | 294 // uninstall notification are notified. |
292 base::MessageLoop::current()->PostTask( | 295 base::MessageLoop::current()->PostTask( |
293 FROM_HERE, | 296 FROM_HERE, |
294 base::Bind(&AppListMainView::QueryChanged, | 297 base::Bind(&AppListMainView::QueryChanged, |
295 weak_ptr_factory_.GetWeakPtr(), | 298 weak_ptr_factory_.GetWeakPtr(), |
296 search_box_view_)); | 299 search_box_view_)); |
297 } | 300 } |
298 | 301 |
299 } // namespace app_list | 302 } // namespace app_list |
OLD | NEW |