| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |