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

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

Issue 186483004: Add a skeleton Start Page to the experimental app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ares_change_experimental_animation
Patch Set: address commnets Created 6 years, 7 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
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"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "ui/app_list/app_list_constants.h" 14 #include "ui/app_list/app_list_constants.h"
15 #include "ui/app_list/app_list_folder_item.h" 15 #include "ui/app_list/app_list_folder_item.h"
16 #include "ui/app_list/app_list_item.h" 16 #include "ui/app_list/app_list_item.h"
17 #include "ui/app_list/app_list_model.h" 17 #include "ui/app_list/app_list_model.h"
18 #include "ui/app_list/app_list_switches.h" 18 #include "ui/app_list/app_list_switches.h"
19 #include "ui/app_list/app_list_view_delegate.h" 19 #include "ui/app_list/app_list_view_delegate.h"
20 #include "ui/app_list/pagination_model.h" 20 #include "ui/app_list/pagination_model.h"
21 #include "ui/app_list/search_box_model.h" 21 #include "ui/app_list/search_box_model.h"
22 #include "ui/app_list/views/app_list_item_view.h" 22 #include "ui/app_list/views/app_list_item_view.h"
23 #include "ui/app_list/views/apps_container_view.h" 23 #include "ui/app_list/views/apps_container_view.h"
24 #include "ui/app_list/views/contents_switcher_view.h" 24 #include "ui/app_list/views/contents_switcher_view.h"
25 #include "ui/app_list/views/contents_view.h" 25 #include "ui/app_list/views/contents_view.h"
tapted 2014/05/08 08:19:50 nit: no longer needed
calamity 2014/05/08 08:31:31 Done.
26 #include "ui/app_list/views/search_box_view.h" 26 #include "ui/app_list/views/search_box_view.h"
27 #include "ui/views/controls/textfield/textfield.h" 27 #include "ui/views/controls/textfield/textfield.h"
28 #include "ui/views/layout/box_layout.h" 28 #include "ui/views/layout/box_layout.h"
29 #include "ui/views/widget/widget.h" 29 #include "ui/views/widget/widget.h"
30 30
31 namespace app_list { 31 namespace app_list {
32 32
33 namespace { 33 namespace {
34 34
35 // Inner padding space in pixels of bubble contents. 35 // Inner padding space in pixels of bubble contents.
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 pending_icon_loaders_.clear(); 158 pending_icon_loaders_.clear();
159 model_ = delegate_->GetModel(); 159 model_ = delegate_->GetModel();
160 search_box_view_->ModelChanged(); 160 search_box_view_->ModelChanged();
161 delete contents_view_; 161 delete contents_view_;
162 contents_view_ = NULL; 162 contents_view_ = NULL;
163 pagination_model_->SelectPage(0, false /* animate */); 163 pagination_model_->SelectPage(0, false /* animate */);
164 AddContentsView(); 164 AddContentsView();
165 Layout(); 165 Layout();
166 } 166 }
167 167
168 void AppListMainView::OnContentsViewShowStateChanged(
169 ContentsView::ShowState show_state) {
170 search_box_view_->SetVisible(show_state != ContentsView::SHOW_START_PAGE);
171 }
172
168 void AppListMainView::SetDragAndDropHostOfCurrentAppList( 173 void AppListMainView::SetDragAndDropHostOfCurrentAppList(
169 ApplicationDragAndDropHost* drag_and_drop_host) { 174 ApplicationDragAndDropHost* drag_and_drop_host) {
170 contents_view_->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); 175 contents_view_->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host);
171 } 176 }
172 177
173 bool AppListMainView::ShouldCenterWindow() const { 178 bool AppListMainView::ShouldCenterWindow() const {
174 return delegate_->ShouldCenterWindow(); 179 return delegate_->ShouldCenterWindow();
175 } 180 }
176 181
177 void AppListMainView::PreloadIcons(gfx::NativeView parent) { 182 void AppListMainView::PreloadIcons(gfx::NativeView parent) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // Resubmit the query via a posted task so that all observers for the 264 // Resubmit the query via a posted task so that all observers for the
260 // uninstall notification are notified. 265 // uninstall notification are notified.
261 base::MessageLoop::current()->PostTask( 266 base::MessageLoop::current()->PostTask(
262 FROM_HERE, 267 FROM_HERE,
263 base::Bind(&AppListMainView::QueryChanged, 268 base::Bind(&AppListMainView::QueryChanged,
264 weak_ptr_factory_.GetWeakPtr(), 269 weak_ptr_factory_.GetWeakPtr(),
265 search_box_view_)); 270 search_box_view_));
266 } 271 }
267 272
268 } // namespace app_list 273 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698