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

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

Issue 2939693004: Added HALF, FULLSCREEN_ALL_APPS, and FULLSCREEN_SEARCH. (Closed)
Patch Set: rebased post revert. Created 3 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
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 }; 54 };
55 55
56 app_list::AppListView* DemoAppListViewDelegate::InitView( 56 app_list::AppListView* DemoAppListViewDelegate::InitView(
57 gfx::NativeWindow window_context) { 57 gfx::NativeWindow window_context) {
58 // On Ash, the app list is placed into an aura::Window container. For the demo 58 // On Ash, the app list is placed into an aura::Window container. For the demo
59 // use the root window context as the parent. This only works on Aura since an 59 // use the root window context as the parent. This only works on Aura since an
60 // aura::Window is also a NativeView. 60 // aura::Window is also a NativeView.
61 gfx::NativeView container = window_context; 61 gfx::NativeView container = window_context;
62 62
63 view_ = new app_list::AppListView(this); 63 view_ = new app_list::AppListView(this);
64 view_->Initialize(container, 0); 64 view_->Initialize(container, 0, false, false);
65 view_->MaybeSetAnchorPoint(gfx::Point(300, 300)); 65 view_->MaybeSetAnchorPoint(gfx::Point(300, 300));
66 66
67 // Populate some apps. 67 // Populate some apps.
68 GetTestModel()->PopulateApps(kInitialItems); 68 GetTestModel()->PopulateApps(kInitialItems);
69 app_list::AppListItemList* item_list = GetTestModel()->top_level_item_list(); 69 app_list::AppListItemList* item_list = GetTestModel()->top_level_item_list();
70 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 70 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
71 gfx::Image test_image = rb.GetImageNamed(IDR_DEFAULT_FAVICON_32); 71 gfx::Image test_image = rb.GetImageNamed(IDR_DEFAULT_FAVICON_32);
72 for (size_t i = 0; i < item_list->item_count(); ++i) { 72 for (size_t i = 0; i < item_list->item_count(); ++i) {
73 app_list::AppListItem* item = item_list->item_at(i); 73 app_list::AppListItem* item = item_list->item_at(i);
74 // Alternate images with shadows and images without. 74 // Alternate images with shadows and images without.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 } // namespace 114 } // namespace
115 115
116 int main(int argc, const char** argv) { 116 int main(int argc, const char** argv) {
117 ui::ViewsContentClient views_content_client(argc, argv); 117 ui::ViewsContentClient views_content_client(argc, argv);
118 118
119 views_content_client.set_task(base::Bind(&ShowAppList)); 119 views_content_client.set_task(base::Bind(&ShowAppList));
120 return views_content_client.RunMain(); 120 return views_content_client.RunMain();
121 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698