Made top controls work with virtual viewport pinch-to-zoom. (Chromium)
[chromium-blink-merge.git] / chromecast / service / cast_service.cc
blob0490b0f50745c5edaf083634bdd03015316b2184
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/service/cast_service.h"
7 #include "base/logging.h"
8 #include "base/threading/thread_checker.h"
10 namespace chromecast {
12 CastService::CastService(
13 content::BrowserContext* browser_context,
14 const OptInStatsChangedCallback& opt_in_stats_callback)
15 : browser_context_(browser_context),
16 opt_in_stats_callback_(opt_in_stats_callback),
17 stopped_(true),
18 thread_checker_(new base::ThreadChecker()) {
21 CastService::~CastService() {
22 DCHECK(thread_checker_->CalledOnValidThread());
23 DCHECK(stopped_);
26 void CastService::Start() {
27 DCHECK(thread_checker_->CalledOnValidThread());
29 Initialize();
30 stopped_ = false;
31 StartInternal();
34 void CastService::Stop() {
35 DCHECK(thread_checker_->CalledOnValidThread());
36 StopInternal();
37 stopped_ = true;
40 } // namespace chromecast