OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 bool RemoteDebuggingEnabled() const { | 83 bool RemoteDebuggingEnabled() const { |
84 const base::CommandLine& command_line = | 84 const base::CommandLine& command_line = |
85 *base::CommandLine::ForCurrentProcess(); | 85 *base::CommandLine::ForCurrentProcess(); |
86 return command_line.HasSwitch(switches::kRemoteDebuggingPort); | 86 return command_line.HasSwitch(switches::kRemoteDebuggingPort); |
87 } | 87 } |
88 | 88 |
89 private: | 89 private: |
90 HeadlessBrowser* browser_; // Not owned. | 90 HeadlessBrowser* browser_; // Not owned. |
91 std::unique_ptr<HeadlessDevToolsClient> devtools_client_; | 91 std::unique_ptr<HeadlessDevToolsClient> devtools_client_; |
92 std::unique_ptr<HeadlessWebContents> web_contents_; | 92 HeadlessWebContents* web_contents_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(HeadlessShell); | 94 DISALLOW_COPY_AND_ASSIGN(HeadlessShell); |
95 }; | 95 }; |
96 | 96 |
97 int main(int argc, const char** argv) { | 97 int main(int argc, const char** argv) { |
98 HeadlessShell shell; | 98 HeadlessShell shell; |
99 HeadlessBrowser::Options::Builder builder(argc, argv); | 99 HeadlessBrowser::Options::Builder builder(argc, argv); |
100 | 100 |
101 // Enable devtools if requested. | 101 // Enable devtools if requested. |
102 base::CommandLine command_line(argc, argv); | 102 base::CommandLine command_line(argc, argv); |
(...skipping 21 matching lines...) Expand all Loading... |
124 LOG(ERROR) << "Malformed proxy server url"; | 124 LOG(ERROR) << "Malformed proxy server url"; |
125 return EXIT_FAILURE; | 125 return EXIT_FAILURE; |
126 } | 126 } |
127 builder.SetProxyServer(parsed_proxy_server); | 127 builder.SetProxyServer(parsed_proxy_server); |
128 } | 128 } |
129 | 129 |
130 return HeadlessBrowserMain( | 130 return HeadlessBrowserMain( |
131 builder.Build(), | 131 builder.Build(), |
132 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell))); | 132 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell))); |
133 } | 133 } |
OLD | NEW |