| 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_BROWSER_SERVICE_CAST_SERVICE_SIMPLE_H_ | 5 #ifndef CHROMECAST_BROWSER_SERVICE_CAST_SERVICE_SIMPLE_H_ |
| 6 #define CHROMECAST_BROWSER_SERVICE_CAST_SERVICE_SIMPLE_H_ | 6 #define CHROMECAST_BROWSER_SERVICE_CAST_SERVICE_SIMPLE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chromecast/browser/cast_content_window.h" | 11 #include "chromecast/browser/cast_content_window.h" |
| 12 #include "chromecast/service/cast_service.h" | 12 #include "chromecast/service/cast_service.h" |
| 13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 class WebContents; | 16 class WebContents; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace chromecast { | 19 namespace chromecast { |
| 20 class CastWindowManager; |
| 21 |
| 20 namespace shell { | 22 namespace shell { |
| 21 | 23 |
| 22 class CastServiceSimple : public CastService, | 24 class CastServiceSimple : public CastService, |
| 23 public CastContentWindow::Delegate { | 25 public CastContentWindow::Delegate { |
| 24 public: | 26 public: |
| 25 CastServiceSimple(content::BrowserContext* browser_context, | 27 CastServiceSimple(content::BrowserContext* browser_context, |
| 26 PrefService* pref_service); | 28 PrefService* pref_service, |
| 29 CastWindowManager* window_manager); |
| 27 ~CastServiceSimple() override; | 30 ~CastServiceSimple() override; |
| 28 | 31 |
| 29 protected: | 32 protected: |
| 30 // CastService implementation: | 33 // CastService implementation: |
| 31 void InitializeInternal() override; | 34 void InitializeInternal() override; |
| 32 void FinalizeInternal() override; | 35 void FinalizeInternal() override; |
| 33 void StartInternal() override; | 36 void StartInternal() override; |
| 34 void StopInternal() override; | 37 void StopInternal() override; |
| 35 | 38 |
| 36 // CastContentWindow::Delegate implementation: | 39 // CastContentWindow::Delegate implementation: |
| 37 void OnWindowDestroyed() override; | 40 void OnWindowDestroyed() override; |
| 38 void OnKeyEvent(const ui::KeyEvent& key_event) override; | 41 void OnKeyEvent(const ui::KeyEvent& key_event) override; |
| 39 | 42 |
| 40 private: | 43 private: |
| 44 CastWindowManager* const window_manager_; |
| 41 std::unique_ptr<CastContentWindow> window_; | 45 std::unique_ptr<CastContentWindow> window_; |
| 42 std::unique_ptr<content::WebContents> web_contents_; | 46 std::unique_ptr<content::WebContents> web_contents_; |
| 43 GURL startup_url_; | 47 GURL startup_url_; |
| 44 | 48 |
| 45 DISALLOW_COPY_AND_ASSIGN(CastServiceSimple); | 49 DISALLOW_COPY_AND_ASSIGN(CastServiceSimple); |
| 46 }; | 50 }; |
| 47 | 51 |
| 48 } // namespace shell | 52 } // namespace shell |
| 49 } // namespace chromecast | 53 } // namespace chromecast |
| 50 | 54 |
| 51 #endif // CHROMECAST_BROWSER_SERVICE_CAST_SERVICE_SIMPLE_H_ | 55 #endif // CHROMECAST_BROWSER_SERVICE_CAST_SERVICE_SIMPLE_H_ |
| OLD | NEW |