OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromecast/browser/cast_browser_process.h" | 5 #include "chromecast/browser/cast_browser_process.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chromecast/base/metrics/cast_metrics_helper.h" | 9 #include "chromecast/base/metrics/cast_metrics_helper.h" |
10 #include "chromecast/browser/cast_browser_context.h" | 10 #include "chromecast/browser/cast_browser_context.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 CastBrowserProcess* g_instance = NULL; | 29 CastBrowserProcess* g_instance = NULL; |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 // static | 32 // static |
33 CastBrowserProcess* CastBrowserProcess::GetInstance() { | 33 CastBrowserProcess* CastBrowserProcess::GetInstance() { |
34 DCHECK(g_instance); | 34 DCHECK(g_instance); |
35 return g_instance; | 35 return g_instance; |
36 } | 36 } |
37 | 37 |
38 CastBrowserProcess::CastBrowserProcess() | 38 CastBrowserProcess::CastBrowserProcess() |
39 : net_log_(nullptr) { | 39 : cast_content_browser_client_(nullptr), |
| 40 net_log_(nullptr) { |
40 DCHECK(!g_instance); | 41 DCHECK(!g_instance); |
41 g_instance = this; | 42 g_instance = this; |
42 } | 43 } |
43 | 44 |
44 CastBrowserProcess::~CastBrowserProcess() { | 45 CastBrowserProcess::~CastBrowserProcess() { |
45 DCHECK_EQ(g_instance, this); | 46 DCHECK_EQ(g_instance, this); |
46 if (pref_service_) | 47 if (pref_service_) |
47 pref_service_->CommitPendingWrite(); | 48 pref_service_->CommitPendingWrite(); |
48 g_instance = NULL; | 49 g_instance = NULL; |
49 } | 50 } |
50 | 51 |
51 void CastBrowserProcess::SetBrowserContext( | 52 void CastBrowserProcess::SetBrowserContext( |
52 scoped_ptr<CastBrowserContext> browser_context) { | 53 scoped_ptr<CastBrowserContext> browser_context) { |
53 DCHECK(!browser_context_); | 54 DCHECK(!browser_context_); |
54 browser_context_.swap(browser_context); | 55 browser_context_.swap(browser_context); |
55 } | 56 } |
56 | 57 |
| 58 void CastBrowserProcess::SetCastContentBrowserClient( |
| 59 CastContentBrowserClient* cast_content_browser_client) { |
| 60 DCHECK(!cast_content_browser_client_); |
| 61 cast_content_browser_client_ = cast_content_browser_client; |
| 62 } |
| 63 |
57 void CastBrowserProcess::SetCastService(scoped_ptr<CastService> cast_service) { | 64 void CastBrowserProcess::SetCastService(scoped_ptr<CastService> cast_service) { |
58 DCHECK(!cast_service_); | 65 DCHECK(!cast_service_); |
59 cast_service_.swap(cast_service); | 66 cast_service_.swap(cast_service); |
60 } | 67 } |
61 | 68 |
62 #if defined(USE_AURA) | 69 #if defined(USE_AURA) |
63 void CastBrowserProcess::SetCastScreen(scoped_ptr<CastScreen> cast_screen) { | 70 void CastBrowserProcess::SetCastScreen(scoped_ptr<CastScreen> cast_screen) { |
64 DCHECK(!cast_screen_); | 71 DCHECK(!cast_screen_); |
65 cast_screen_ = cast_screen.Pass(); | 72 cast_screen_ = cast_screen.Pass(); |
66 } | 73 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 connectivity_checker_.swap(connectivity_checker); | 116 connectivity_checker_.swap(connectivity_checker); |
110 } | 117 } |
111 | 118 |
112 void CastBrowserProcess::SetNetLog(net::NetLog* net_log) { | 119 void CastBrowserProcess::SetNetLog(net::NetLog* net_log) { |
113 DCHECK(!net_log_); | 120 DCHECK(!net_log_); |
114 net_log_ = net_log; | 121 net_log_ = net_log; |
115 } | 122 } |
116 | 123 |
117 } // namespace shell | 124 } // namespace shell |
118 } // namespace chromecast | 125 } // namespace chromecast |
OLD | NEW |