Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: ui/app_list/views/app_list_main_view.cc

Issue 660463003: Add a SearchResultPageView to the experimental app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@search_result_container_view
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/app_list.gyp ('k') | ui/app_list/views/app_list_view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 contents_view_ = NULL; 171 contents_view_ = NULL;
172 if (contents_switcher_view_) { 172 if (contents_switcher_view_) {
173 delete contents_switcher_view_; 173 delete contents_switcher_view_;
174 contents_switcher_view_ = NULL; 174 contents_switcher_view_ = NULL;
175 } 175 }
176 AddContentsViews(); 176 AddContentsViews();
177 Layout(); 177 Layout();
178 } 178 }
179 179
180 void AppListMainView::UpdateSearchBoxVisibility() { 180 void AppListMainView::UpdateSearchBoxVisibility() {
181 bool visible = !contents_view_->IsStateActive(AppListModel::STATE_START) || 181 bool visible = !contents_view_->IsStateActive(AppListModel::STATE_START);
182 contents_view_->IsShowingSearchResults();
183 search_box_view_->SetVisible(visible); 182 search_box_view_->SetVisible(visible);
184 if (visible && GetWidget() && GetWidget()->IsVisible()) 183 if (visible && GetWidget() && GetWidget()->IsVisible())
185 search_box_view_->search_box()->RequestFocus(); 184 search_box_view_->search_box()->RequestFocus();
186 } 185 }
187 186
188 void AppListMainView::OnStartPageSearchTextfieldChanged( 187 void AppListMainView::OnStartPageSearchTextfieldChanged(
189 const base::string16& new_contents) { 188 const base::string16& new_contents) {
190 search_box_view_->SetVisible(true); 189 search_box_view_->SetVisible(true);
191 search_box_view_->search_box()->SetText(new_contents); 190 search_box_view_->search_box()->SetText(new_contents);
192 search_box_view_->search_box()->RequestFocus(); 191 search_box_view_->search_box()->RequestFocus();
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 // Resubmit the query via a posted task so that all observers for the 301 // Resubmit the query via a posted task so that all observers for the
303 // uninstall notification are notified. 302 // uninstall notification are notified.
304 base::MessageLoop::current()->PostTask( 303 base::MessageLoop::current()->PostTask(
305 FROM_HERE, 304 FROM_HERE,
306 base::Bind(&AppListMainView::QueryChanged, 305 base::Bind(&AppListMainView::QueryChanged,
307 weak_ptr_factory_.GetWeakPtr(), 306 weak_ptr_factory_.GetWeakPtr(),
308 search_box_view_)); 307 search_box_view_));
309 } 308 }
310 309
311 } // namespace app_list 310 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/app_list.gyp ('k') | ui/app_list/views/app_list_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698