Index: headless/lib/headless_shell_main_delegate.h |
diff --git a/headless/lib/headless_shell_main_delegate.h b/headless/lib/headless_shell_main_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3131c0449b21acada59a25ec657db03b77c8e9da |
--- /dev/null |
+++ b/headless/lib/headless_shell_main_delegate.h |
@@ -0,0 +1,60 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef HEADLESS_LIB_HEADLESS_SHELL_MAIN_DELEGATE_H_ |
+#define HEADLESS_LIB_HEADLESS_SHELL_MAIN_DELEGATE_H_ |
+ |
+#include "base/compiler_specific.h" |
+#include "base/macros.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "content/public/app/content_main_delegate.h" |
+#include "headless/lib/headless_content_client.h" |
+ |
+namespace content { |
+class BrowserContext; |
+} |
+ |
+namespace headless { |
+ |
+class HeadlessBrowserImpl; |
+class HeadlessContentBrowserClient; |
+class HeadlessContentUtilityClient; |
+class HeadlessContentRendererClient; |
+ |
+class HeadlessShellMainDelegate : public content::ContentMainDelegate { |
+ public: |
+ HeadlessShellMainDelegate(HeadlessBrowserImpl* browser); |
+ ~HeadlessShellMainDelegate() override; |
+ |
+ // ContentMainDelegate implementation: |
+ bool BasicStartupComplete(int* exit_code) override; |
+ void PreSandboxStartup() override; |
+ int RunProcess( |
+ const std::string& process_type, |
+ const content::MainFunctionParams& main_function_params) override; |
+ void ZygoteForked() override; |
+ content::ContentBrowserClient* CreateContentBrowserClient() override; |
+ content::ContentRendererClient* CreateContentRendererClient() override; |
+ content::ContentUtilityClient* CreateContentUtilityClient() override; |
+ |
+ private: |
+ friend class HeadlessBrowser; |
+ |
+ static void InitializeResourceBundle(); |
+ |
+ content::BrowserContext* browser_context(); |
+ |
+ scoped_ptr<HeadlessContentBrowserClient> browser_client_; |
+ scoped_ptr<HeadlessContentRendererClient> renderer_client_; |
+ scoped_ptr<HeadlessContentUtilityClient> utility_client_; |
+ HeadlessContentClient content_client_; |
+ |
+ HeadlessBrowserImpl* browser_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(HeadlessShellMainDelegate); |
+}; |
+ |
+} // namespace headless |
+ |
+#endif // HEADLESS_LIB_HEADLESS_SHELL_MAIN_DELEGATE_H_ |