Index: chromecast/shell/browser/cast_browser_main_parts.h |
diff --git a/chromecast/shell/browser/cast_browser_main_parts.h b/chromecast/shell/browser/cast_browser_main_parts.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6ef10feedc9dc2434faa791dd22e1dc528b94333 |
--- /dev/null |
+++ b/chromecast/shell/browser/cast_browser_main_parts.h |
@@ -0,0 +1,59 @@ |
+// Copyright 2014 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 CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ |
+#define CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ |
+ |
+#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "content/public/browser/browser_main_parts.h" |
+ |
+namespace content { |
+struct MainFunctionParams; |
+} |
+ |
+namespace chromecast { |
+ |
+class CastService; |
+ |
+namespace shell { |
+ |
+class CastBrowserContext; |
+class URLRequestContextFactory; |
+ |
+class CastBrowserMainParts : public content::BrowserMainParts { |
+ public: |
+ CastBrowserMainParts( |
+ const content::MainFunctionParams& parameters, |
+ URLRequestContextFactory* url_request_context_factory); |
+ virtual ~CastBrowserMainParts(); |
+ |
+ // Overridden from content::BrowserMainParts. |
+ virtual void PreMainMessageLoopStart() OVERRIDE; |
+ virtual void PostMainMessageLoopStart() OVERRIDE; |
+ virtual int PreCreateThreads() OVERRIDE; |
+ virtual void PreMainMessageLoopRun() OVERRIDE; |
+ virtual bool MainMessageLoopRun(int* result_code) OVERRIDE; |
+ virtual void PostMainMessageLoopRun() OVERRIDE; |
+ |
+ CastBrowserContext* browser_context() { |
+ return browser_context_.get(); |
+ } |
+ |
+ private: |
+ static CastBrowserMainParts* GetInstance(); |
+ |
+ static CastBrowserMainParts* instance_; |
+ scoped_ptr<CastBrowserContext> browser_context_; |
+ scoped_ptr<CastService> cast_service_; |
+ URLRequestContextFactory* const url_request_context_factory_; |
+ |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CastBrowserMainParts); |
+}; |
+ |
+} // namespace shell |
+} // namespace chromecast |
+ |
+#endif // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ |