Disabling AX test for select.html.
[chromium-blink-merge.git] / chromecast / browser / cast_browser_process.cc
blob050ff0d3fe86154a638741255c4b99af5b9caafe
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 #include "chromecast/browser/cast_browser_process.h"
7 #include "base/logging.h"
8 #include "chromecast/base/metrics/cast_metrics_helper.h"
9 #include "chromecast/browser/cast_browser_context.h"
10 #include "chromecast/browser/devtools/remote_debugging_server.h"
11 #include "chromecast/browser/metrics/cast_metrics_service_client.h"
12 #include "chromecast/browser/service/cast_service.h"
14 #if defined(OS_ANDROID)
15 #include "components/crash/browser/crash_dump_manager_android.h"
16 #endif // defined(OS_ANDROID)
18 #if defined(USE_AURA)
19 #include "ui/aura/env.h"
20 #endif
22 namespace chromecast {
23 namespace shell {
25 namespace {
26 CastBrowserProcess* g_instance = NULL;
27 } // namespace
29 // static
30 CastBrowserProcess* CastBrowserProcess::GetInstance() {
31 DCHECK(g_instance);
32 return g_instance;
35 CastBrowserProcess::CastBrowserProcess() {
36 DCHECK(!g_instance);
37 g_instance = this;
40 CastBrowserProcess::~CastBrowserProcess() {
41 DCHECK_EQ(g_instance, this);
42 #if defined(USE_AURA)
43 aura::Env::DeleteInstance();
44 #endif
45 g_instance = NULL;
48 void CastBrowserProcess::SetBrowserContext(
49 CastBrowserContext* browser_context) {
50 DCHECK(!browser_context_);
51 browser_context_.reset(browser_context);
54 void CastBrowserProcess::SetCastService(CastService* cast_service) {
55 DCHECK(!cast_service_);
56 cast_service_.reset(cast_service);
59 void CastBrowserProcess::SetRemoteDebuggingServer(
60 RemoteDebuggingServer* remote_debugging_server) {
61 DCHECK(!remote_debugging_server_);
62 remote_debugging_server_.reset(remote_debugging_server);
65 void CastBrowserProcess::SetMetricsHelper(
66 metrics::CastMetricsHelper* metrics_helper) {
67 DCHECK(!metrics_helper_);
68 metrics_helper_.reset(metrics_helper);
71 void CastBrowserProcess::SetMetricsServiceClient(
72 metrics::CastMetricsServiceClient* metrics_service_client) {
73 DCHECK(!metrics_service_client_);
74 metrics_service_client_.reset(metrics_service_client);
77 #if defined(OS_ANDROID)
78 void CastBrowserProcess::SetCrashDumpManager(
79 breakpad::CrashDumpManager* crash_dump_manager) {
80 DCHECK(!crash_dump_manager_);
81 crash_dump_manager_.reset(crash_dump_manager);
83 #endif // defined(OS_ANDROID)
85 } // namespace shell
86 } // namespace chromecast