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_web_contents.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 { | |
16 class WebContents; | |
17 } | |
18 | |
19 namespace chromecast { | 15 namespace chromecast { |
20 namespace shell { | 16 namespace shell { |
21 | 17 |
22 class CastServiceSimple : public CastService, | 18 class CastServiceSimple : public CastService, |
23 public CastContentWindow::Delegate { | 19 public CastWebContents::Delegate { |
24 public: | 20 public: |
25 CastServiceSimple(content::BrowserContext* browser_context, | 21 CastServiceSimple(content::BrowserContext* browser_context, |
26 PrefService* pref_service); | 22 PrefService* pref_service); |
27 ~CastServiceSimple() override; | 23 ~CastServiceSimple() override; |
28 | 24 |
29 protected: | 25 protected: |
30 // CastService implementation: | 26 // CastService implementation: |
31 void InitializeInternal() override; | 27 void InitializeInternal() override; |
32 void FinalizeInternal() override; | 28 void FinalizeInternal() override; |
33 void StartInternal() override; | 29 void StartInternal() override; |
34 void StopInternal() override; | 30 void StopInternal() override; |
35 | 31 |
| 32 // CastWebContents::Delegate implementation: |
| 33 void OnPageStopped(int error_code) override; |
| 34 void OnLoadingStateChanged(bool loading) override; |
| 35 |
36 // CastContentWindow::Delegate implementation: | 36 // CastContentWindow::Delegate implementation: |
37 void OnWindowDestroyed() override; | 37 void OnWindowDestroyed() override; |
38 void OnKeyEvent(const ui::KeyEvent& key_event) override; | 38 void OnKeyEvent(const ui::KeyEvent& key_event) override; |
39 | 39 |
40 private: | 40 private: |
41 std::unique_ptr<CastContentWindow> window_; | 41 std::unique_ptr<CastWebContents> cast_web_contents_; |
42 std::unique_ptr<content::WebContents> web_contents_; | |
43 GURL startup_url_; | 42 GURL startup_url_; |
44 | 43 |
45 DISALLOW_COPY_AND_ASSIGN(CastServiceSimple); | 44 DISALLOW_COPY_AND_ASSIGN(CastServiceSimple); |
46 }; | 45 }; |
47 | 46 |
48 } // namespace shell | 47 } // namespace shell |
49 } // namespace chromecast | 48 } // namespace chromecast |
50 | 49 |
51 #endif // CHROMECAST_BROWSER_SERVICE_CAST_SERVICE_SIMPLE_H_ | 50 #endif // CHROMECAST_BROWSER_SERVICE_CAST_SERVICE_SIMPLE_H_ |
OLD | NEW |