Chromium Code Reviews| 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 #ifndef CHROMECAST_SERVICE_CAST_SERVICE_H_ | 5 #ifndef CHROMECAST_SERVICE_CAST_SERVICE_H_ |
| 6 #define CHROMECAST_SERVICE_CAST_SERVICE_H_ | 6 #define CHROMECAST_SERVICE_CAST_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 | 10 |
| 11 namespace aura { | |
| 12 class WindowTreeHost; | |
| 13 } | |
| 14 | |
| 15 namespace base { | 11 namespace base { |
| 16 class ThreadChecker; | 12 class ThreadChecker; |
| 17 } | 13 } |
| 18 | 14 |
| 19 namespace content{ | 15 namespace content{ |
| 20 class BrowserContext; | 16 class BrowserContext; |
| 21 class WebContents; | |
| 22 } | 17 } |
| 23 | 18 |
| 24 namespace chromecast { | 19 namespace chromecast { |
| 25 | 20 |
| 26 class CastService { | 21 class CastService { |
| 27 public: | 22 public: |
| 28 explicit CastService(content::BrowserContext* browser_context); | |
| 29 virtual ~CastService(); | 23 virtual ~CastService(); |
| 24 static CastService* Create(content::BrowserContext* browser_context); | |
|
damienv1
2014/07/16 23:59:40
nit: Usually static functions come first (should b
gunsch
2014/07/17 04:33:37
Done.
| |
| 30 | 25 |
| 31 // Start/stop the cast service. | 26 // Start/stop the cast service. |
| 32 void Start(); | 27 void Start(); |
| 33 void Stop(); | 28 void Stop(); |
| 34 | 29 |
| 30 protected: | |
| 31 explicit CastService(content::BrowserContext* browser_context); | |
| 32 virtual void Initialize() = 0; | |
| 33 | |
| 34 // Implementation-specific start/stop behavior. | |
| 35 virtual void StartInternal() = 0; | |
| 36 virtual void StopInternal() = 0; | |
| 37 | |
| 38 content::BrowserContext* browser_context() const { return browser_context_; } | |
| 39 | |
| 35 private: | 40 private: |
| 36 // Platform specific initialization if any. | |
| 37 static void PlatformInitialize(); | |
| 38 | |
| 39 void Initialize(); | |
| 40 | |
| 41 content::BrowserContext* const browser_context_; | 41 content::BrowserContext* const browser_context_; |
| 42 scoped_ptr<aura::WindowTreeHost> window_tree_host_; | |
| 43 scoped_ptr<content::WebContents> web_contents_; | |
| 44 bool stopped_; | 42 bool stopped_; |
| 45 | 43 |
| 46 const scoped_ptr<base::ThreadChecker> thread_checker_; | 44 const scoped_ptr<base::ThreadChecker> thread_checker_; |
| 47 | 45 |
| 48 DISALLOW_COPY_AND_ASSIGN(CastService); | 46 DISALLOW_COPY_AND_ASSIGN(CastService); |
| 49 }; | 47 }; |
| 50 | 48 |
| 51 } // namespace chromecast | 49 } // namespace chromecast |
| 52 | 50 |
| 53 #endif // CHROMECAST_SERVICE_CAST_SERVICE_H_ | 51 #endif // CHROMECAST_SERVICE_CAST_SERVICE_H_ |
| OLD | NEW |