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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 : delegate_(delegate), | 47 : delegate_(delegate), |
| 48 model_(delegate->GetModel()), | 48 model_(delegate->GetModel()), |
| 49 search_box_view_(nullptr), | 49 search_box_view_(nullptr), |
| 50 contents_view_(nullptr) { | 50 contents_view_(nullptr) { |
| 51 SetLayoutManager( | 51 SetLayoutManager( |
| 52 features::IsAnswerCardEnabled() | 52 features::IsAnswerCardEnabled() |
| 53 ? static_cast<views::LayoutManager*>(new views::FillLayout) | 53 ? static_cast<views::LayoutManager*>(new views::FillLayout) |
| 54 : static_cast<views::LayoutManager*>( | 54 : static_cast<views::LayoutManager*>( |
| 55 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0))); | 55 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0))); |
| 56 model_->AddObserver(this); | 56 model_->AddObserver(this); |
| 57 SetPaintToLayer(); | |
|
xiyuan
2017/05/24 18:28:18
Remove this. Or remove the call in AppListView::In
newcomer
2017/05/25 23:10:51
Done.
| |
| 57 } | 58 } |
| 58 | 59 |
| 59 AppListMainView::~AppListMainView() { | 60 AppListMainView::~AppListMainView() { |
| 60 model_->RemoveObserver(this); | 61 model_->RemoveObserver(this); |
| 61 } | 62 } |
| 62 | 63 |
| 63 void AppListMainView::Init(gfx::NativeView parent, | 64 void AppListMainView::Init(gfx::NativeView parent, |
| 64 int initial_apps_page, | 65 int initial_apps_page, |
| 65 SearchBoxView* search_box_view) { | 66 SearchBoxView* search_box_view) { |
| 66 search_box_view_ = search_box_view; | 67 search_box_view_ = search_box_view; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 contents_view_->search_results_page_view()->SetSelection(select); | 214 contents_view_->search_results_page_view()->SetSelection(select); |
| 214 } | 215 } |
| 215 | 216 |
| 216 void AppListMainView::OnResultInstalled(SearchResult* result) { | 217 void AppListMainView::OnResultInstalled(SearchResult* result) { |
| 217 // Clears the search to show the apps grid. The last installed app | 218 // Clears the search to show the apps grid. The last installed app |
| 218 // should be highlighted and made visible already. | 219 // should be highlighted and made visible already. |
| 219 search_box_view_->ClearSearch(); | 220 search_box_view_->ClearSearch(); |
| 220 } | 221 } |
| 221 | 222 |
| 222 } // namespace app_list | 223 } // namespace app_list |
| OLD | NEW |