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 "content/public/browser/content_browser_client.h" | |
15 #include "content/public/renderer/content_renderer_client.h" | |
16 #include "headless/lib/browser/headless_platform_event_source.h" | 14 #include "headless/lib/browser/headless_platform_event_source.h" |
17 #include "headless/lib/headless_content_client.h" | 15 #include "headless/lib/headless_content_client.h" |
18 #include "headless/public/headless_export.h" | 16 #include "headless/public/headless_export.h" |
19 | 17 |
20 namespace base { | 18 namespace base { |
21 class CommandLine; | 19 class CommandLine; |
22 } | 20 } |
23 | 21 |
24 namespace headless { | 22 namespace headless { |
25 | 23 |
26 class HeadlessBrowserImpl; | 24 class HeadlessBrowserImpl; |
| 25 class HeadlessContentBrowserClient; |
| 26 class HeadlessContentRendererClient; |
27 | 27 |
28 // Exported for tests. | 28 // Exported for tests. |
29 class HEADLESS_EXPORT HeadlessContentMainDelegate | 29 class HEADLESS_EXPORT HeadlessContentMainDelegate |
30 : public content::ContentMainDelegate { | 30 : public content::ContentMainDelegate { |
31 public: | 31 public: |
32 explicit HeadlessContentMainDelegate( | 32 explicit HeadlessContentMainDelegate( |
33 std::unique_ptr<HeadlessBrowserImpl> browser); | 33 std::unique_ptr<HeadlessBrowserImpl> browser); |
34 ~HeadlessContentMainDelegate() override; | 34 ~HeadlessContentMainDelegate() override; |
35 | 35 |
36 // content::ContentMainDelegate implementation: | 36 // content::ContentMainDelegate implementation: |
(...skipping 13 matching lines...) Expand all Loading... |
50 | 50 |
51 private: | 51 private: |
52 friend class HeadlessBrowserTest; | 52 friend class HeadlessBrowserTest; |
53 | 53 |
54 void InitLogging(const base::CommandLine& command_line); | 54 void InitLogging(const base::CommandLine& command_line); |
55 void InitCrashReporter(const base::CommandLine& command_line); | 55 void InitCrashReporter(const base::CommandLine& command_line); |
56 static void InitializeResourceBundle(); | 56 static void InitializeResourceBundle(); |
57 | 57 |
58 static HeadlessContentMainDelegate* GetInstance(); | 58 static HeadlessContentMainDelegate* GetInstance(); |
59 | 59 |
60 std::unique_ptr<content::ContentRendererClient> renderer_client_; | 60 std::unique_ptr<HeadlessContentBrowserClient> browser_client_; |
61 std::unique_ptr<content::ContentBrowserClient> browser_client_; | 61 std::unique_ptr<HeadlessContentRendererClient> renderer_client_; |
62 HeadlessContentClient content_client_; | 62 HeadlessContentClient content_client_; |
63 HeadlessPlatformEventSource platform_event_source_; | 63 HeadlessPlatformEventSource platform_event_source_; |
64 | 64 |
65 std::unique_ptr<HeadlessBrowserImpl> browser_; | 65 std::unique_ptr<HeadlessBrowserImpl> browser_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(HeadlessContentMainDelegate); | 67 DISALLOW_COPY_AND_ASSIGN(HeadlessContentMainDelegate); |
68 }; | 68 }; |
69 | 69 |
70 } // namespace headless | 70 } // namespace headless |
71 | 71 |
72 #endif // HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ | 72 #endif // HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ |
OLD | NEW |