Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / chromecast / browser / cast_browser_process.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_BROWSER_CAST_BROWSER_PROCESS_H_
6 #define CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10
11 namespace breakpad {
12 class CrashDumpManager;
13 }  // namespace breakpad
14
15 namespace chromecast {
16 class CastService;
17 class WebCryptoServer;
18
19 namespace metrics {
20 class CastMetricsHelper;
21 class CastMetricsServiceClient;
22 }  // namespace metrics
23
24 namespace shell {
25 class CastBrowserContext;
26 class RemoteDebuggingServer;
27
28 class CastBrowserProcess {
29  public:
30   // Gets the global instance of CastBrowserProcess. Does not create lazily and
31   // assumes the instance already exists.
32   static CastBrowserProcess* GetInstance();
33
34   CastBrowserProcess();
35   virtual ~CastBrowserProcess();
36
37   void SetBrowserContext(CastBrowserContext* browser_context);
38   void SetCastService(CastService* cast_service);
39   void SetRemoteDebuggingServer(RemoteDebuggingServer* remote_debugging_server);
40   void SetMetricsHelper(metrics::CastMetricsHelper* metrics_helper);
41   void SetMetricsServiceClient(
42       metrics::CastMetricsServiceClient* metrics_service_client);
43 #if defined(OS_ANDROID)
44   void SetCrashDumpManager(breakpad::CrashDumpManager* crash_dump_manager);
45 #endif  // defined(OS_ANDROID)
46
47   CastBrowserContext* browser_context() const { return browser_context_.get(); }
48   CastService* cast_service() const { return cast_service_.get(); }
49   metrics::CastMetricsServiceClient* metrics_service_client() const {
50     return metrics_service_client_.get();
51   }
52
53  private:
54   scoped_ptr<CastBrowserContext> browser_context_;
55   scoped_ptr<metrics::CastMetricsHelper> metrics_helper_;
56   scoped_ptr<metrics::CastMetricsServiceClient> metrics_service_client_;
57   scoped_ptr<RemoteDebuggingServer> remote_debugging_server_;
58 #if defined(OS_ANDROID)
59   scoped_ptr<breakpad::CrashDumpManager> crash_dump_manager_;
60 #endif  // defined(OS_ANDROID)
61
62   // Note: CastService must be destroyed before others.
63   scoped_ptr<CastService> cast_service_;
64
65   DISALLOW_COPY_AND_ASSIGN(CastBrowserProcess);
66 };
67
68 }  // namespace shell
69 }  // namespace chromecast
70
71 #endif  // CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_