Chromium Code Reviews| 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) | |
|
vadimt
2017/06/22 00:36:12
state == AppListModel::STATE_APPS &&
newcomer
2017/06/22 16:49:06
Done.
| |
| 214 ? apps_container_view_->IsInFolderView() | |
| 215 : false; | |
| 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(app_list_main_view()->search_box_view())) | |
| 223 app_list_main_view_->search_box_view()->SwapGoogleIconWithBackButton( | |
|
vadimt
2017/06/22 00:36:12
{}
newcomer
2017/06/22 16:49:06
Done.
| |
| 224 folder_active); | |
| 221 } | 225 } |
| 222 | 226 |
| 223 // Whenever the page changes, the custom launcher page is considered to have | 227 // Whenever the page changes, the custom launcher page is considered to have |
| 224 // been reset. | 228 // been reset. |
| 225 app_list_main_view_->model()->ClearCustomLauncherPageSubpages(); | 229 app_list_main_view_->model()->ClearCustomLauncherPageSubpages(); |
| 226 app_list_main_view_->search_box_view()->ResetTabFocus(false); | 230 app_list_main_view_->search_box_view()->ResetTabFocus(false); |
| 227 } | 231 } |
| 228 | 232 |
| 229 void ContentsView::ShowSearchResults(bool show) { | 233 void ContentsView::ShowSearchResults(bool show) { |
| 230 int search_page = GetPageIndexForState(AppListModel::STATE_SEARCH_RESULTS); | 234 int search_page = GetPageIndexForState(AppListModel::STATE_SEARCH_RESULTS); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 485 } | 489 } |
| 486 | 490 |
| 487 void ContentsView::TransitionStarted() { | 491 void ContentsView::TransitionStarted() { |
| 488 } | 492 } |
| 489 | 493 |
| 490 void ContentsView::TransitionChanged() { | 494 void ContentsView::TransitionChanged() { |
| 491 UpdatePageBounds(); | 495 UpdatePageBounds(); |
| 492 } | 496 } |
| 493 | 497 |
| 494 } // namespace app_list | 498 } // namespace app_list |
| OLD | NEW |