OLD | NEW |
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 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_MAIN_PARTS_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_MAIN_PARTS_H_ |
6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_MAIN_PARTS_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_MAIN_PARTS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
| 10 #include "base/files/file_path.h" |
10 #include "content/public/browser/browser_main_parts.h" | 11 #include "content/public/browser/browser_main_parts.h" |
11 #include "headless/public/headless_browser.h" | 12 #include "headless/public/headless_browser.h" |
12 | 13 |
13 namespace headless { | 14 namespace headless { |
14 | 15 |
| 16 class HeadlessNetLog; |
15 class HeadlessBrowserImpl; | 17 class HeadlessBrowserImpl; |
16 | 18 |
17 class HeadlessBrowserMainParts : public content::BrowserMainParts { | 19 class HeadlessBrowserMainParts : public content::BrowserMainParts { |
18 public: | 20 public: |
19 explicit HeadlessBrowserMainParts(HeadlessBrowserImpl* browser); | 21 explicit HeadlessBrowserMainParts(HeadlessBrowserImpl* browser); |
20 ~HeadlessBrowserMainParts() override; | 22 ~HeadlessBrowserMainParts() override; |
21 | 23 |
22 // content::BrowserMainParts implementation: | 24 // content::BrowserMainParts implementation: |
23 void PreMainMessageLoopRun() override; | 25 void PreMainMessageLoopRun() override; |
24 void PostMainMessageLoopRun() override; | 26 void PostMainMessageLoopRun() override; |
25 #if defined(OS_MACOSX) | 27 #if defined(OS_MACOSX) |
26 void PreMainMessageLoopStart() override; | 28 void PreMainMessageLoopStart() override; |
27 #endif | 29 #endif |
28 | 30 |
| 31 HeadlessNetLog* net_log() const { return net_log_.get(); } |
| 32 |
29 private: | 33 private: |
30 HeadlessBrowserImpl* browser_; // Not owned. | 34 HeadlessBrowserImpl* browser_; // Not owned. |
31 | 35 |
32 bool devtools_http_handler_started_; | 36 bool devtools_http_handler_started_; |
| 37 std::unique_ptr<HeadlessNetLog> net_log_; |
33 | 38 |
34 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserMainParts); | 39 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserMainParts); |
35 }; | 40 }; |
36 | 41 |
37 } // namespace headless | 42 } // namespace headless |
38 | 43 |
39 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_MAIN_PARTS_H_ | 44 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_MAIN_PARTS_H_ |
OLD | NEW |