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.
5 #ifndef CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_
6 #define CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_
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"
14 struct MainFunctionParams;
17 namespace chromecast {
23 class CastBrowserContext;
24 class RemoteDebuggingServer;
25 class URLRequestContextFactory;
27 class CastBrowserMainParts : public content::BrowserMainParts {
30 const content::MainFunctionParams& parameters,
31 URLRequestContextFactory* url_request_context_factory);
32 virtual ~CastBrowserMainParts();
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;
42 CastBrowserContext* browser_context() {
43 return browser_context_.get();
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_;
52 DISALLOW_COPY_AND_ASSIGN(CastBrowserMainParts);
56 } // namespace chromecast
58 #endif // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_