| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 false /* border_accepts_events */); | 69 false /* border_accepts_events */); |
| 70 | 70 |
| 71 // Populate some apps. | 71 // Populate some apps. |
| 72 GetTestModel()->PopulateApps(kInitialItems); | 72 GetTestModel()->PopulateApps(kInitialItems); |
| 73 app_list::AppListItemList* item_list = GetTestModel()->top_level_item_list(); | 73 app_list::AppListItemList* item_list = GetTestModel()->top_level_item_list(); |
| 74 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 74 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 75 gfx::Image test_image = rb.GetImageNamed(IDR_DEFAULT_FAVICON_32); | 75 gfx::Image test_image = rb.GetImageNamed(IDR_DEFAULT_FAVICON_32); |
| 76 for (size_t i = 0; i < item_list->item_count(); ++i) { | 76 for (size_t i = 0; i < item_list->item_count(); ++i) { |
| 77 app_list::AppListItem* item = item_list->item_at(i); | 77 app_list::AppListItem* item = item_list->item_at(i); |
| 78 // Alternate images with shadows and images without. | 78 // Alternate images with shadows and images without. |
| 79 item->SetIcon(*test_image.ToImageSkia(), i & 1); | 79 item->SetIcon(*test_image.ToImageSkia()); |
| 80 } | 80 } |
| 81 return view_; | 81 return view_; |
| 82 } | 82 } |
| 83 | 83 |
| 84 void DemoAppListViewDelegate::Dismiss() { | 84 void DemoAppListViewDelegate::Dismiss() { |
| 85 view_->GetWidget()->Close(); | 85 view_->GetWidget()->Close(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void DemoAppListViewDelegate::ViewClosing() { | 88 void DemoAppListViewDelegate::ViewClosing() { |
| 89 base::MessageLoop* message_loop = base::MessageLoopForUI::current(); | 89 base::MessageLoop* message_loop = base::MessageLoopForUI::current(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 content::InitializeSandboxInfo(&sandbox_info); | 123 content::InitializeSandboxInfo(&sandbox_info); |
| 124 ui::ViewsContentClient views_content_client(instance, &sandbox_info); | 124 ui::ViewsContentClient views_content_client(instance, &sandbox_info); |
| 125 #else | 125 #else |
| 126 int main(int argc, const char** argv) { | 126 int main(int argc, const char** argv) { |
| 127 ui::ViewsContentClient views_content_client(argc, argv); | 127 ui::ViewsContentClient views_content_client(argc, argv); |
| 128 #endif | 128 #endif |
| 129 | 129 |
| 130 views_content_client.set_task(base::Bind(&ShowAppList)); | 130 views_content_client.set_task(base::Bind(&ShowAppList)); |
| 131 return views_content_client.RunMain(); | 131 return views_content_client.RunMain(); |
| 132 } | 132 } |
| OLD | NEW |