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

Side by Side Diff: ui/app_list/demo/app_list_demo_views.cc

Issue 2802903003: Implementation of a full screen app list and re-alphabetized switches (Closed)
Patch Set: Fixed the mishandled reference that was breaking the build Created 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 }; 53 };
54 54
55 app_list::AppListView* DemoAppListViewDelegate::InitView( 55 app_list::AppListView* DemoAppListViewDelegate::InitView(
56 gfx::NativeWindow window_context) { 56 gfx::NativeWindow window_context) {
57 // On Ash, the app list is placed into an aura::Window container. For the demo 57 // On Ash, the app list is placed into an aura::Window container. For the demo
58 // use the root window context as the parent. This only works on Aura since an 58 // use the root window context as the parent. This only works on Aura since an
59 // aura::Window is also a NativeView. 59 // aura::Window is also a NativeView.
60 gfx::NativeView container = window_context; 60 gfx::NativeView container = window_context;
61 61
62 view_ = new app_list::AppListView(this); 62 view_ = new app_list::AppListView(this);
63 view_->InitAsBubble(container, 0); 63 view_->Initialize(container, 0);
64 view_->SetAnchorPoint(gfx::Point(300, 300)); 64 view_->MaybeSetAnchorPoint(gfx::Point(300, 300));
65 65
66 // Populate some apps. 66 // Populate some apps.
67 GetTestModel()->PopulateApps(kInitialItems); 67 GetTestModel()->PopulateApps(kInitialItems);
68 app_list::AppListItemList* item_list = GetTestModel()->top_level_item_list(); 68 app_list::AppListItemList* item_list = GetTestModel()->top_level_item_list();
69 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 69 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
70 gfx::Image test_image = rb.GetImageNamed(IDR_DEFAULT_FAVICON_32); 70 gfx::Image test_image = rb.GetImageNamed(IDR_DEFAULT_FAVICON_32);
71 for (size_t i = 0; i < item_list->item_count(); ++i) { 71 for (size_t i = 0; i < item_list->item_count(); ++i) {
72 app_list::AppListItem* item = item_list->item_at(i); 72 app_list::AppListItem* item = item_list->item_at(i);
73 // Alternate images with shadows and images without. 73 // Alternate images with shadows and images without.
74 item->SetIcon(*test_image.ToImageSkia()); 74 item->SetIcon(*test_image.ToImageSkia());
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 } // namespace 113 } // namespace
114 114
115 int main(int argc, const char** argv) { 115 int main(int argc, const char** argv) {
116 ui::ViewsContentClient views_content_client(argc, argv); 116 ui::ViewsContentClient views_content_client(argc, argv);
117 117
118 views_content_client.set_task(base::Bind(&ShowAppList)); 118 views_content_client.set_task(base::Bind(&ShowAppList));
119 return views_content_client.RunMain(); 119 return views_content_client.RunMain();
120 } 120 }
OLDNEW
« no previous file with comments | « ui/app_list/app_list_switches.cc ('k') | ui/app_list/presenter/app_list_presenter_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698