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/service/cast_service_android.h"
8 #include "chromecast/android/chromecast_config_android.h"
9 #include "chromecast/browser/metrics/cast_metrics_service_client.h"
11 namespace chromecast
{
14 scoped_ptr
<CastService
> CastService::Create(
15 content::BrowserContext
* browser_context
,
16 PrefService
* pref_service
,
17 metrics::CastMetricsServiceClient
* metrics_service_client
,
18 net::URLRequestContextGetter
* request_context_getter
) {
19 return scoped_ptr
<CastService
>(
20 new CastServiceAndroid(browser_context
,
22 metrics_service_client
));
25 CastServiceAndroid::CastServiceAndroid(
26 content::BrowserContext
* browser_context
,
27 PrefService
* pref_service
,
28 metrics::CastMetricsServiceClient
* metrics_service_client
)
29 : CastService(browser_context
, pref_service
, metrics_service_client
) {
32 CastServiceAndroid::~CastServiceAndroid() {
35 void CastServiceAndroid::InitializeInternal() {
36 android::ChromecastConfigAndroid::GetInstance()->
37 SetSendUsageStatsChangedCallback(
38 base::Bind(&metrics::CastMetricsServiceClient::EnableMetricsService
,
39 base::Unretained(metrics_service_client())));
42 void CastServiceAndroid::FinalizeInternal() {
43 android::ChromecastConfigAndroid::GetInstance()->
44 SetSendUsageStatsChangedCallback(base::Callback
<void(bool)>());
47 void CastServiceAndroid::StartInternal() {
50 void CastServiceAndroid::StopInternal() {
53 } // namespace chromecast