| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 web_contents_->GetBrowserContext()); | 104 web_contents_->GetBrowserContext()); |
| 105 web_view->SetPreferredSize(size); | 105 web_view->SetPreferredSize(size); |
| 106 web_view->SetWebContents(web_contents_.get()); | 106 web_view->SetWebContents(web_contents_.get()); |
| 107 return web_view; | 107 return web_view; |
| 108 } | 108 } |
| 109 | 109 |
| 110 void ShowAppList(content::BrowserContext* browser_context, | 110 void ShowAppList(content::BrowserContext* browser_context, |
| 111 gfx::NativeWindow window_context) { | 111 gfx::NativeWindow window_context) { |
| 112 DemoAppListViewDelegate* delegate = | 112 DemoAppListViewDelegate* delegate = |
| 113 new DemoAppListViewDelegate(browser_context); | 113 new DemoAppListViewDelegate(browser_context); |
| 114 app_list::AppListView* view = delegate->InitView(window_context); | 114 app_list::AppListView* view = delegate->InitView(NULL); |
| 115 view->GetWidget()->Show(); | 115 view->GetWidget()->Show(); |
| 116 view->GetWidget()->Activate(); | 116 view->GetWidget()->Activate(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace | 119 } // namespace |
| 120 | 120 |
| 121 #if defined(OS_WIN) | 121 #if defined(OS_WIN) |
| 122 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { | 122 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { |
| 123 sandbox::SandboxInterfaceInfo sandbox_info = {0}; | 123 sandbox::SandboxInterfaceInfo sandbox_info = {0}; |
| 124 content::InitializeSandboxInfo(&sandbox_info); | 124 content::InitializeSandboxInfo(&sandbox_info); |
| 125 ui::ViewsContentClient views_content_client(instance, &sandbox_info); | 125 ui::ViewsContentClient views_content_client(instance, &sandbox_info); |
| 126 #else | 126 #else |
| 127 int main(int argc, const char** argv) { | 127 int main(int argc, const char** argv) { |
| 128 ui::ViewsContentClient views_content_client(argc, argv); | 128 ui::ViewsContentClient views_content_client(argc, argv); |
| 129 #endif | 129 #endif |
| 130 | 130 |
| 131 views_content_client.set_task(base::Bind(&ShowAppList)); | 131 views_content_client.set_task(base::Bind(&ShowAppList)); |
| 132 return views_content_client.RunMain(); | 132 return views_content_client.RunMain(); |
| 133 } | 133 } |
| OLD | NEW |