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" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/single_thread_task_runner.h" |
13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
14 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
15 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
16 #include "ui/app_list/test/app_list_test_model.h" | 17 #include "ui/app_list/test/app_list_test_model.h" |
17 #include "ui/app_list/test/app_list_test_view_delegate.h" | 18 #include "ui/app_list/test/app_list_test_view_delegate.h" |
18 #include "ui/app_list/views/app_list_view.h" | 19 #include "ui/app_list/views/app_list_view.h" |
19 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
20 #include "ui/resources/grit/ui_resources.h" | 21 #include "ui/resources/grit/ui_resources.h" |
21 #include "ui/views/controls/webview/webview.h" | 22 #include "ui/views/controls/webview/webview.h" |
22 #include "ui/views_content_client/views_content_client.h" | 23 #include "ui/views_content_client/views_content_client.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 86 } |
86 return view_; | 87 return view_; |
87 } | 88 } |
88 | 89 |
89 void DemoAppListViewDelegate::Dismiss() { | 90 void DemoAppListViewDelegate::Dismiss() { |
90 view_->GetWidget()->Close(); | 91 view_->GetWidget()->Close(); |
91 } | 92 } |
92 | 93 |
93 void DemoAppListViewDelegate::ViewClosing() { | 94 void DemoAppListViewDelegate::ViewClosing() { |
94 base::MessageLoop* message_loop = base::MessageLoopForUI::current(); | 95 base::MessageLoop* message_loop = base::MessageLoopForUI::current(); |
95 message_loop->DeleteSoon(FROM_HERE, this); | 96 message_loop->task_runner()->DeleteSoon(FROM_HERE, this); |
96 message_loop->QuitWhenIdle(); | 97 message_loop->QuitWhenIdle(); |
97 } | 98 } |
98 | 99 |
99 views::View* DemoAppListViewDelegate::CreateStartPageWebView( | 100 views::View* DemoAppListViewDelegate::CreateStartPageWebView( |
100 const gfx::Size& size) { | 101 const gfx::Size& size) { |
101 web_contents_.reset(content::WebContents::Create( | 102 web_contents_.reset(content::WebContents::Create( |
102 content::WebContents::CreateParams(browser_context_))); | 103 content::WebContents::CreateParams(browser_context_))); |
103 web_contents_->GetController().LoadURL(GURL("http://www.google.com/"), | 104 web_contents_->GetController().LoadURL(GURL("http://www.google.com/"), |
104 content::Referrer(), | 105 content::Referrer(), |
105 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 106 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
(...skipping 22 matching lines...) Expand all Loading... |
128 content::InitializeSandboxInfo(&sandbox_info); | 129 content::InitializeSandboxInfo(&sandbox_info); |
129 ui::ViewsContentClient views_content_client(instance, &sandbox_info); | 130 ui::ViewsContentClient views_content_client(instance, &sandbox_info); |
130 #else | 131 #else |
131 int main(int argc, const char** argv) { | 132 int main(int argc, const char** argv) { |
132 ui::ViewsContentClient views_content_client(argc, argv); | 133 ui::ViewsContentClient views_content_client(argc, argv); |
133 #endif | 134 #endif |
134 | 135 |
135 views_content_client.set_task(base::Bind(&ShowAppList)); | 136 views_content_client.set_task(base::Bind(&ShowAppList)); |
136 return views_content_client.RunMain(); | 137 return views_content_client.RunMain(); |
137 } | 138 } |
OLD | NEW |