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