Chromium Code Reviews| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 //////////////////////////////////////////////////////////////////////////////// | 44 //////////////////////////////////////////////////////////////////////////////// |
| 45 // AppListMainView: | 45 // AppListMainView: |
| 46 | 46 |
| 47 AppListMainView::AppListMainView(AppListViewDelegate* delegate, | 47 AppListMainView::AppListMainView(AppListViewDelegate* delegate, |
| 48 AppListView* app_list_view) | 48 AppListView* app_list_view) |
| 49 : delegate_(delegate), | 49 : delegate_(delegate), |
| 50 model_(delegate->GetModel()), | 50 model_(delegate->GetModel()), |
| 51 search_box_view_(nullptr), | 51 search_box_view_(nullptr), |
| 52 contents_view_(nullptr), | 52 contents_view_(nullptr), |
| 53 app_list_view_(app_list_view) { | 53 app_list_view_(app_list_view) { |
| 54 SetLayoutManager( | 54 SetLayoutManager(static_cast<views::LayoutManager*>( |
|
xiyuan
2017/06/12 16:16:13
Is static_cast still necessary?
vadimt
2017/06/12 18:13:11
Done.
| |
| 55 features::IsAnswerCardEnabled() | 55 new views::BoxLayout(views::BoxLayout::kVertical, gfx::Insets(), 0))); |
| 56 ? static_cast<views::LayoutManager*>(new views::FillLayout) | |
| 57 : static_cast<views::LayoutManager*>(new views::BoxLayout( | |
| 58 views::BoxLayout::kVertical, gfx::Insets(), 0))); | |
| 59 model_->AddObserver(this); | 56 model_->AddObserver(this); |
| 60 } | 57 } |
| 61 | 58 |
| 62 AppListMainView::~AppListMainView() { | 59 AppListMainView::~AppListMainView() { |
| 63 model_->RemoveObserver(this); | 60 model_->RemoveObserver(this); |
| 64 } | 61 } |
| 65 | 62 |
| 66 void AppListMainView::Init(gfx::NativeView parent, | 63 void AppListMainView::Init(gfx::NativeView parent, |
| 67 int initial_apps_page, | 64 int initial_apps_page, |
| 68 SearchBoxView* search_box_view) { | 65 SearchBoxView* search_box_view) { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 contents_view_->search_results_page_view()->SetSelection(select); | 212 contents_view_->search_results_page_view()->SetSelection(select); |
| 216 } | 213 } |
| 217 | 214 |
| 218 void AppListMainView::OnResultInstalled(SearchResult* result) { | 215 void AppListMainView::OnResultInstalled(SearchResult* result) { |
| 219 // Clears the search to show the apps grid. The last installed app | 216 // Clears the search to show the apps grid. The last installed app |
| 220 // should be highlighted and made visible already. | 217 // should be highlighted and made visible already. |
| 221 search_box_view_->ClearSearch(); | 218 search_box_view_->ClearSearch(); |
| 222 } | 219 } |
| 223 | 220 |
| 224 } // namespace app_list | 221 } // namespace app_list |
| OLD | NEW |