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 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 if (it != view_to_state_.end()) | 203 if (it != view_to_state_.end()) |
204 state = it->second; | 204 state = it->second; |
205 | 205 |
206 app_list_pages_[GetActivePageIndex()]->OnWillBeShown(); | 206 app_list_pages_[GetActivePageIndex()]->OnWillBeShown(); |
207 | 207 |
208 app_list_main_view_->model()->SetState(state); | 208 app_list_main_view_->model()->SetState(state); |
209 | 209 |
210 DCHECK(start_page_view_); | 210 DCHECK(start_page_view_); |
211 | 211 |
212 // Set the visibility of the search box's back button. | 212 // Set the visibility of the search box's back button. |
213 bool folder_active = state == AppListModel::STATE_APPS && | |
xiyuan
2017/06/22 17:33:24
nit: bool -> const bool
newcomer
2017/06/23 23:28:08
Done.
| |
214 apps_container_view_->IsInFolderView(); | |
215 | |
213 if (!features::IsFullscreenAppListEnabled()) { | 216 if (!features::IsFullscreenAppListEnabled()) { |
214 app_list_main_view_->search_box_view()->back_button()->SetVisible( | 217 app_list_main_view_->search_box_view()->back_button()->SetVisible( |
215 state != AppListModel::STATE_START); | 218 state != AppListModel::STATE_START); |
216 app_list_main_view_->search_box_view()->Layout(); | 219 app_list_main_view_->search_box_view()->Layout(); |
217 bool folder_active = (state == AppListModel::STATE_APPS) | |
218 ? apps_container_view_->IsInFolderView() | |
219 : false; | |
220 app_list_main_view_->search_box_view()->SetBackButtonLabel(folder_active); | 220 app_list_main_view_->search_box_view()->SetBackButtonLabel(folder_active); |
221 } else { | |
222 if (app_list_main_view()->Contains( | |
vadimt
2017/06/22 18:28:08
Nit: app_list_main_view_
newcomer
2017/06/23 23:28:08
Done.
| |
223 app_list_main_view()->search_box_view())) { | |
xiyuan
2017/06/22 17:33:24
Saw a comment says the SearchBoxView is added to a
newcomer
2017/06/23 23:28:08
You're correct, that code was not getting ran. Tha
| |
224 app_list_main_view_->search_box_view()->ShowBackOrGoogleIcon( | |
225 folder_active); | |
226 } | |
221 } | 227 } |
222 | 228 |
223 // Whenever the page changes, the custom launcher page is considered to have | 229 // Whenever the page changes, the custom launcher page is considered to have |
224 // been reset. | 230 // been reset. |
225 app_list_main_view_->model()->ClearCustomLauncherPageSubpages(); | 231 app_list_main_view_->model()->ClearCustomLauncherPageSubpages(); |
226 app_list_main_view_->search_box_view()->ResetTabFocus(false); | 232 app_list_main_view_->search_box_view()->ResetTabFocus(false); |
227 } | 233 } |
228 | 234 |
229 void ContentsView::ShowSearchResults(bool show) { | 235 void ContentsView::ShowSearchResults(bool show) { |
230 int search_page = GetPageIndexForState(AppListModel::STATE_SEARCH_RESULTS); | 236 int search_page = GetPageIndexForState(AppListModel::STATE_SEARCH_RESULTS); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 } | 491 } |
486 | 492 |
487 void ContentsView::TransitionStarted() { | 493 void ContentsView::TransitionStarted() { |
488 } | 494 } |
489 | 495 |
490 void ContentsView::TransitionChanged() { | 496 void ContentsView::TransitionChanged() { |
491 UpdatePageBounds(); | 497 UpdatePageBounds(); |
492 } | 498 } |
493 | 499 |
494 } // namespace app_list | 500 } // namespace app_list |
OLD | NEW |