Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chromecast / service / cast_service.h
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.
4
5 #ifndef CHROMECAST_SERVICE_CAST_SERVICE_H_
6 #define CHROMECAST_SERVICE_CAST_SERVICE_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10
11 namespace base {
12 class ThreadChecker;
13 }
14
15 namespace content{
16 class BrowserContext;
17 }
18
19 namespace chromecast {
20
21 class CastService {
22  public:
23   static CastService* Create(content::BrowserContext* browser_context);
24
25   virtual ~CastService();
26
27   // Start/stop the cast service.
28   void Start();
29   void Stop();
30
31  protected:
32   explicit CastService(content::BrowserContext* browser_context);
33   virtual void Initialize() = 0;
34
35   // Implementation-specific start/stop behavior.
36   virtual void StartInternal() = 0;
37   virtual void StopInternal() = 0;
38
39   content::BrowserContext* browser_context() const { return browser_context_; }
40
41  private:
42   content::BrowserContext* const browser_context_;
43   bool stopped_;
44
45   const scoped_ptr<base::ThreadChecker> thread_checker_;
46
47   DISALLOW_COPY_AND_ASSIGN(CastService);
48 };
49
50 }  // namespace chromecast
51
52 #endif  // CHROMECAST_SERVICE_CAST_SERVICE_H_