| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 void AppListMainView::ModelChanged() { | 163 void AppListMainView::ModelChanged() { |
| 164 pending_icon_loaders_.clear(); | 164 pending_icon_loaders_.clear(); |
| 165 model_ = delegate_->GetModel(); | 165 model_ = delegate_->GetModel(); |
| 166 search_box_view_->ModelChanged(); | 166 search_box_view_->ModelChanged(); |
| 167 delete contents_view_; | 167 delete contents_view_; |
| 168 contents_view_ = NULL; | 168 contents_view_ = NULL; |
| 169 AddContentsView(); | 169 AddContentsView(); |
| 170 Layout(); | 170 Layout(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void AppListMainView::OnContentsViewShowStateChanged() { | 173 void AppListMainView::OnContentsViewActivePageChanged() { |
| 174 search_box_view_->SetVisible(contents_view_->show_state() != | 174 search_box_view_->SetVisible( |
| 175 ContentsView::SHOW_START_PAGE); | 175 !contents_view_->IsNamedPageActive(ContentsView::SHOW_START_PAGE)); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void AppListMainView::OnStartPageSearchButtonPressed() { | 178 void AppListMainView::OnStartPageSearchButtonPressed() { |
| 179 search_box_view_->SetVisible(true); | 179 search_box_view_->SetVisible(true); |
| 180 search_box_view_->search_box()->SetText(base::string16()); | 180 search_box_view_->search_box()->SetText(base::string16()); |
| 181 search_box_view_->RequestFocus(); | 181 search_box_view_->RequestFocus(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void AppListMainView::SetDragAndDropHostOfCurrentAppList( | 184 void AppListMainView::SetDragAndDropHostOfCurrentAppList( |
| 185 ApplicationDragAndDropHost* drag_and_drop_host) { | 185 ApplicationDragAndDropHost* drag_and_drop_host) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // Resubmit the query via a posted task so that all observers for the | 285 // Resubmit the query via a posted task so that all observers for the |
| 286 // uninstall notification are notified. | 286 // uninstall notification are notified. |
| 287 base::MessageLoop::current()->PostTask( | 287 base::MessageLoop::current()->PostTask( |
| 288 FROM_HERE, | 288 FROM_HERE, |
| 289 base::Bind(&AppListMainView::QueryChanged, | 289 base::Bind(&AppListMainView::QueryChanged, |
| 290 weak_ptr_factory_.GetWeakPtr(), | 290 weak_ptr_factory_.GetWeakPtr(), |
| 291 search_box_view_)); | 291 search_box_view_)); |
| 292 } | 292 } |
| 293 | 293 |
| 294 } // namespace app_list | 294 } // namespace app_list |
| OLD | NEW |