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/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/public/browser/browser_main_parts.h" |
| 12 |
| 13 namespace content { |
| 14 struct MainFunctionParams; |
| 15 } |
| 16 |
| 17 namespace chromecast { |
| 18 |
| 19 class CastService; |
| 20 |
| 21 namespace shell { |
| 22 |
| 23 class CastBrowserContext; |
| 24 class URLRequestContextFactory; |
| 25 |
| 26 class CastBrowserMainParts : public content::BrowserMainParts { |
| 27 public: |
| 28 CastBrowserMainParts( |
| 29 const content::MainFunctionParams& parameters, |
| 30 URLRequestContextFactory* url_request_context_factory); |
| 31 virtual ~CastBrowserMainParts(); |
| 32 |
| 33 // content::BrowserMainParts implementation: |
| 34 virtual void PreMainMessageLoopStart() OVERRIDE; |
| 35 virtual void PostMainMessageLoopStart() OVERRIDE; |
| 36 virtual int PreCreateThreads() OVERRIDE; |
| 37 virtual void PreMainMessageLoopRun() OVERRIDE; |
| 38 virtual bool MainMessageLoopRun(int* result_code) OVERRIDE; |
| 39 virtual void PostMainMessageLoopRun() OVERRIDE; |
| 40 |
| 41 CastBrowserContext* browser_context() { |
| 42 return browser_context_.get(); |
| 43 } |
| 44 |
| 45 private: |
| 46 static CastBrowserMainParts* GetInstance(); |
| 47 |
| 48 static CastBrowserMainParts* instance_; |
| 49 scoped_ptr<CastBrowserContext> browser_context_; |
| 50 scoped_ptr<CastService> cast_service_; |
| 51 URLRequestContextFactory* const url_request_context_factory_; |
| 52 |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(CastBrowserMainParts); |
| 55 }; |
| 56 |
| 57 } // namespace shell |
| 58 } // namespace chromecast |
| 59 |
| 60 #endif // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ |
OLD | NEW |