| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 contents_view_ = new ContentsView(this); | 80 contents_view_ = new ContentsView(this); |
| 81 contents_view_->Init(model_); | 81 contents_view_->Init(model_); |
| 82 AddChildView(contents_view_); | 82 AddChildView(contents_view_); |
| 83 | 83 |
| 84 search_box_view_->set_contents_view(contents_view_); | 84 search_box_view_->set_contents_view(contents_view_); |
| 85 | 85 |
| 86 contents_view_->SetPaintToLayer(); | 86 contents_view_->SetPaintToLayer(); |
| 87 contents_view_->layer()->SetFillsBoundsOpaquely(false); | 87 contents_view_->layer()->SetFillsBoundsOpaquely(false); |
| 88 contents_view_->layer()->SetMasksToBounds(true); | 88 contents_view_->layer()->SetMasksToBounds(true); |
| 89 | 89 |
| 90 delegate_->StartSearch(); | 90 // Clear the old query and start search. |
| 91 search_box_view_->ClearSearch(); |
| 91 } | 92 } |
| 92 | 93 |
| 93 void AppListMainView::ShowAppListWhenReady() { | 94 void AppListMainView::ShowAppListWhenReady() { |
| 94 GetWidget()->Show(); | 95 GetWidget()->Show(); |
| 95 } | 96 } |
| 96 | 97 |
| 97 void AppListMainView::ResetForShow() { | 98 void AppListMainView::ResetForShow() { |
| 98 contents_view_->SetActiveState(AppListModel::STATE_START); | 99 contents_view_->SetActiveState(AppListModel::STATE_START); |
| 99 contents_view_->apps_container_view()->ResetForShowApps(); | 100 contents_view_->apps_container_view()->ResetForShowApps(); |
| 100 // We clear the search when hiding so when app list appears it is not showing | 101 // We clear the search when hiding so when app list appears it is not showing |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 contents_view_->search_results_page_view()->SetSelection(select); | 213 contents_view_->search_results_page_view()->SetSelection(select); |
| 213 } | 214 } |
| 214 | 215 |
| 215 void AppListMainView::OnResultInstalled(SearchResult* result) { | 216 void AppListMainView::OnResultInstalled(SearchResult* result) { |
| 216 // Clears the search to show the apps grid. The last installed app | 217 // Clears the search to show the apps grid. The last installed app |
| 217 // should be highlighted and made visible already. | 218 // should be highlighted and made visible already. |
| 218 search_box_view_->ClearSearch(); | 219 search_box_view_->ClearSearch(); |
| 219 } | 220 } |
| 220 | 221 |
| 221 } // namespace app_list | 222 } // namespace app_list |
| OLD | NEW |