11320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci// Copyright 2014 The Chromium Authors. All rights reserved.
21320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci// Use of this source code is governed by a BSD-style license that can be
31320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci// found in the LICENSE file.
41320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
51320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#ifndef CHROMECAST_SHELL_BROWSER_CAST_BROWSER_PROCESS_H_
61320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#define CHROMECAST_SHELL_BROWSER_CAST_BROWSER_PROCESS_H_
71320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
81320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "base/macros.h"
91320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "base/memory/scoped_ptr.h"
101320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
111320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tuccinamespace breakpad {
121320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass CrashDumpManager;
131320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci}  // namespace breakpad
141320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
151320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tuccinamespace chromecast {
161320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass CastService;
171320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass WebCryptoServer;
181320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
191320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tuccinamespace metrics {
201320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass CastMetricsHelper;
211320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass CastMetricsServiceClient;
221320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci}  // namespace metrics
231320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
241320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tuccinamespace shell {
251320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass CastBrowserContext;
261320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass RemoteDebuggingServer;
271320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
281320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass CastBrowserProcess {
291320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci public:
301320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // Gets the global instance of CastBrowserProcess. Does not create lazily and
311320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // assumes the instance already exists.
321320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  static CastBrowserProcess* GetInstance();
331320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
341320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  CastBrowserProcess();
351320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  virtual ~CastBrowserProcess();
361320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
371320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  void SetBrowserContext(CastBrowserContext* browser_context);
381320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  void SetCastService(CastService* cast_service);
391320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  void SetRemoteDebuggingServer(RemoteDebuggingServer* remote_debugging_server);
401320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  void SetMetricsServiceClient(
411320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci      metrics::CastMetricsServiceClient* metrics_service_client);
421320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
431320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  CastBrowserContext* browser_context() const { return browser_context_.get(); }
441320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  CastService* cast_service() const { return cast_service_.get(); }
451320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  metrics::CastMetricsServiceClient* metrics_service_client() const {
461320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    return metrics_service_client_.get();
471320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  }
481320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
491320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci private:
501320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  scoped_ptr<CastBrowserContext> browser_context_;
511320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  scoped_ptr<metrics::CastMetricsServiceClient> metrics_service_client_;
521320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  scoped_ptr<RemoteDebuggingServer> remote_debugging_server_;
531320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
541320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // Note: CastService must be destroyed before others.
551320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  scoped_ptr<CastService> cast_service_;
561320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
571320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  DISALLOW_COPY_AND_ASSIGN(CastBrowserProcess);
581320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci};
591320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
601320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci}  // namespace shell
611320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci}  // namespace chromecast
621320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
631320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#endif  // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_PROCESS_H_
64