Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / chromecast / service / cast_service.h
blob606f8f7c87b6d89850fe6efccf72adfa223afeea
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 #ifndef CHROMECAST_SERVICE_CAST_SERVICE_H_
6 #define CHROMECAST_SERVICE_CAST_SERVICE_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
11 namespace base {
12 class ThreadChecker;
15 namespace content{
16 class BrowserContext;
19 namespace chromecast {
21 class CastService {
22 public:
23 static CastService* Create(content::BrowserContext* browser_context);
25 virtual ~CastService();
27 // Start/stop the cast service.
28 void Start();
29 void Stop();
31 protected:
32 explicit CastService(content::BrowserContext* browser_context);
33 virtual void Initialize() = 0;
35 // Implementation-specific start/stop behavior.
36 virtual void StartInternal() = 0;
37 virtual void StopInternal() = 0;
39 content::BrowserContext* browser_context() const { return browser_context_; }
41 private:
42 content::BrowserContext* const browser_context_;
43 bool stopped_;
45 const scoped_ptr<base::ThreadChecker> thread_checker_;
47 DISALLOW_COPY_AND_ASSIGN(CastService);
50 } // namespace chromecast
52 #endif // CHROMECAST_SERVICE_CAST_SERVICE_H_