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

Side by Side Diff: headless/lib/browser/headless_browser_impl.cc

Issue 2438853002: Renames aura::client::WindowTreeClient to WindowParentingClient (Closed)
Patch Set: cleanup Created 4 years, 1 month 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
« no previous file with comments | « headless/lib/browser/headless_browser_impl.h ('k') | headless/lib/browser/headless_screen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "headless/lib/browser/headless_browser_impl.h" 5 #include "headless/lib/browser/headless_browser_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
13 #include "base/threading/thread_task_runner_handle.h" 13 #include "base/threading/thread_task_runner_handle.h"
14 #include "content/public/app/content_main.h" 14 #include "content/public/app/content_main.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
17 #include "content/public/common/content_switches.h" 17 #include "content/public/common/content_switches.h"
18 #include "headless/lib/browser/headless_browser_context_impl.h" 18 #include "headless/lib/browser/headless_browser_context_impl.h"
19 #include "headless/lib/browser/headless_browser_main_parts.h" 19 #include "headless/lib/browser/headless_browser_main_parts.h"
20 #include "headless/lib/browser/headless_web_contents_impl.h" 20 #include "headless/lib/browser/headless_web_contents_impl.h"
21 #include "headless/lib/browser/headless_window_tree_client.h" 21 #include "headless/lib/browser/headless_window_parenting_client.h"
22 #include "headless/lib/headless_content_main_delegate.h" 22 #include "headless/lib/headless_content_main_delegate.h"
23 #include "ui/aura/env.h" 23 #include "ui/aura/env.h"
24 #include "ui/aura/window_tree_host.h" 24 #include "ui/aura/window_tree_host.h"
25 #include "ui/gfx/geometry/size.h" 25 #include "ui/gfx/geometry/size.h"
26 26
27 namespace headless { 27 namespace headless {
28 namespace { 28 namespace {
29 29
30 int RunContentMain( 30 int RunContentMain(
31 HeadlessBrowser::Options options, 31 HeadlessBrowser::Options options,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 DCHECK(!browser_main_parts_); 116 DCHECK(!browser_main_parts_);
117 browser_main_parts_ = browser_main_parts; 117 browser_main_parts_ = browser_main_parts;
118 } 118 }
119 119
120 void HeadlessBrowserImpl::RunOnStartCallback() { 120 void HeadlessBrowserImpl::RunOnStartCallback() {
121 DCHECK(aura::Env::GetInstance()); 121 DCHECK(aura::Env::GetInstance());
122 window_tree_host_.reset( 122 window_tree_host_.reset(
123 aura::WindowTreeHost::Create(gfx::Rect(options()->window_size))); 123 aura::WindowTreeHost::Create(gfx::Rect(options()->window_size)));
124 window_tree_host_->InitHost(); 124 window_tree_host_->InitHost();
125 125
126 window_tree_client_.reset( 126 window_parenting_client_.reset(
127 new HeadlessWindowTreeClient(window_tree_host_->window())); 127 new HeadlessWindowParentingClient(window_tree_host_->window()));
128 128
129 on_start_callback_.Run(this); 129 on_start_callback_.Run(this);
130 on_start_callback_ = base::Callback<void(HeadlessBrowser*)>(); 130 on_start_callback_ = base::Callback<void(HeadlessBrowser*)>();
131 } 131 }
132 132
133 HeadlessBrowserContext* HeadlessBrowserImpl::CreateBrowserContext( 133 HeadlessBrowserContext* HeadlessBrowserImpl::CreateBrowserContext(
134 HeadlessBrowserContext::Builder* builder) { 134 HeadlessBrowserContext::Builder* builder) {
135 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 135 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
136 136
137 std::unique_ptr<HeadlessBrowserContextImpl> browser_context = 137 std::unique_ptr<HeadlessBrowserContextImpl> browser_context =
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 // Child processes should not end up here. 206 // Child processes should not end up here.
207 base::CommandLine command_line(options.argc, options.argv); 207 base::CommandLine command_line(options.argc, options.argv);
208 DCHECK(!command_line.HasSwitch(switches::kProcessType)); 208 DCHECK(!command_line.HasSwitch(switches::kProcessType));
209 #endif 209 #endif
210 return RunContentMain(std::move(options), 210 return RunContentMain(std::move(options),
211 std::move(on_browser_start_callback)); 211 std::move(on_browser_start_callback));
212 } 212 }
213 213
214 } // namespace headless 214 } // namespace headless
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_browser_impl.h ('k') | headless/lib/browser/headless_screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698