OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ |
| 6 #define CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/public/browser/browser_main_parts.h" |
| 11 |
| 12 namespace content { |
| 13 struct MainFunctionParams; |
| 14 } |
| 15 |
| 16 namespace chromecast { |
| 17 |
| 18 class CastService; |
| 19 |
| 20 namespace shell { |
| 21 |
| 22 class CastBrowserContext; |
| 23 class URLRequestContextFactory; |
| 24 |
| 25 class CastBrowserMainParts : public content::BrowserMainParts { |
| 26 public: |
| 27 CastBrowserMainParts( |
| 28 const content::MainFunctionParams& parameters, |
| 29 URLRequestContextFactory* url_request_context_factory); |
| 30 virtual ~CastBrowserMainParts(); |
| 31 |
| 32 // Overridden from content::BrowserMainParts. |
| 33 virtual void PreMainMessageLoopStart() OVERRIDE; |
| 34 virtual void PostMainMessageLoopStart() OVERRIDE; |
| 35 virtual int PreCreateThreads() OVERRIDE; |
| 36 virtual void PreMainMessageLoopRun() OVERRIDE; |
| 37 virtual bool MainMessageLoopRun(int* result_code) OVERRIDE; |
| 38 virtual void PostMainMessageLoopRun() OVERRIDE; |
| 39 |
| 40 CastBrowserContext* browser_context() { |
| 41 return browser_context_.get(); |
| 42 } |
| 43 |
| 44 private: |
| 45 static CastBrowserMainParts* GetInstance(); |
| 46 |
| 47 static CastBrowserMainParts* instance_; |
| 48 scoped_ptr<CastBrowserContext> browser_context_; |
| 49 scoped_ptr<CastService> cast_service_; |
| 50 URLRequestContextFactory* const url_request_context_factory_; |
| 51 |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(CastBrowserMainParts); |
| 54 }; |
| 55 |
| 56 } // namespace shell |
| 57 } // namespace chromecast |
| 58 |
| 59 #endif // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ |
OLD | NEW |