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

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

Issue 317723005: Refactor app list ContentsView to use page indices, not show states. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed again, and rewrote comments for AddLauncherPage. Created 6 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « ui/app_list/views/app_list_main_view.h ('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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::NAMED_PAGE_START));
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
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
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_main_view.h ('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