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_HEADLESS_CONTENT_MAIN_DELEGATE_H_ | 5 #ifndef HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ |
6 #define HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ | 6 #define HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "content/public/app/content_main_delegate.h" | 13 #include "content/public/app/content_main_delegate.h" |
14 #include "headless/lib/browser/headless_platform_event_source.h" | 14 #include "headless/lib/browser/headless_platform_event_source.h" |
15 #include "headless/lib/headless_content_client.h" | 15 #include "headless/lib/headless_content_client.h" |
| 16 #include "headless/public/headless_export.h" |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class CommandLine; | 19 class CommandLine; |
19 } | 20 } |
20 | 21 |
21 namespace headless { | 22 namespace headless { |
22 | 23 |
23 class HeadlessBrowserImpl; | 24 class HeadlessBrowserImpl; |
24 class HeadlessContentBrowserClient; | 25 class HeadlessContentBrowserClient; |
25 | 26 |
26 class HeadlessContentMainDelegate : public content::ContentMainDelegate { | 27 // Exported for tests. |
| 28 class HEADLESS_EXPORT HeadlessContentMainDelegate |
| 29 : public content::ContentMainDelegate { |
27 public: | 30 public: |
28 explicit HeadlessContentMainDelegate( | 31 explicit HeadlessContentMainDelegate( |
29 std::unique_ptr<HeadlessBrowserImpl> browser); | 32 std::unique_ptr<HeadlessBrowserImpl> browser); |
30 ~HeadlessContentMainDelegate() override; | 33 ~HeadlessContentMainDelegate() override; |
31 | 34 |
32 // content::ContentMainDelegate implementation: | 35 // content::ContentMainDelegate implementation: |
33 bool BasicStartupComplete(int* exit_code) override; | 36 bool BasicStartupComplete(int* exit_code) override; |
34 void PreSandboxStartup() override; | 37 void PreSandboxStartup() override; |
35 int RunProcess( | 38 int RunProcess( |
36 const std::string& process_type, | 39 const std::string& process_type, |
(...skipping 20 matching lines...) Expand all Loading... |
57 HeadlessPlatformEventSource platform_event_source_; | 60 HeadlessPlatformEventSource platform_event_source_; |
58 | 61 |
59 std::unique_ptr<HeadlessBrowserImpl> browser_; | 62 std::unique_ptr<HeadlessBrowserImpl> browser_; |
60 | 63 |
61 DISALLOW_COPY_AND_ASSIGN(HeadlessContentMainDelegate); | 64 DISALLOW_COPY_AND_ASSIGN(HeadlessContentMainDelegate); |
62 }; | 65 }; |
63 | 66 |
64 } // namespace headless | 67 } // namespace headless |
65 | 68 |
66 #endif // HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ | 69 #endif // HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ |
OLD | NEW |