988ceea92f3e971973dd2b3d7e22c81b54477369
[platform/framework/web/crosswalk.git] / src / chromecast / shell / browser / cast_browser_main_parts.h
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 RemoteDebuggingServer;
25 class URLRequestContextFactory;
26
27 class CastBrowserMainParts : public content::BrowserMainParts {
28  public:
29   CastBrowserMainParts(
30       const content::MainFunctionParams& parameters,
31       URLRequestContextFactory* url_request_context_factory);
32   virtual ~CastBrowserMainParts();
33
34   // content::BrowserMainParts implementation:
35   virtual void PreMainMessageLoopStart() OVERRIDE;
36   virtual void PostMainMessageLoopStart() OVERRIDE;
37   virtual int PreCreateThreads() OVERRIDE;
38   virtual void PreMainMessageLoopRun() OVERRIDE;
39   virtual bool MainMessageLoopRun(int* result_code) OVERRIDE;
40   virtual void PostMainMessageLoopRun() OVERRIDE;
41
42   CastBrowserContext* browser_context() {
43     return browser_context_.get();
44   }
45
46  private:
47   scoped_ptr<CastBrowserContext> browser_context_;
48   scoped_ptr<CastService> cast_service_;
49   scoped_ptr<RemoteDebuggingServer> dev_tools_;
50   URLRequestContextFactory* const url_request_context_factory_;
51
52   DISALLOW_COPY_AND_ASSIGN(CastBrowserMainParts);
53 };
54
55 }  // namespace shell
56 }  // namespace chromecast
57
58 #endif  // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_