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_ANDROID_CAST_WINDOW_ANDROID_H_ | 5 #ifndef CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_ |
6 #define CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_ | 6 #define CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... | |
26 | 26 |
27 class GURL; | 27 class GURL; |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 class BrowserContext; | 30 class BrowserContext; |
31 class SiteInstance; | 31 class SiteInstance; |
32 class WebContents; | 32 class WebContents; |
33 } // namespace content | 33 } // namespace content |
34 | 34 |
35 namespace chromecast { | 35 namespace chromecast { |
36 class CastContentWindow; | |
36 namespace shell { | 37 namespace shell { |
37 | 38 |
38 class CastWindowAndroid : public content::WebContentsDelegate, | 39 class CastWindowAndroid : public content::WebContentsDelegate, |
39 public content::WebContentsObserver { | 40 public content::WebContentsObserver { |
40 public: | 41 public: |
41 // Creates a new window and immediately loads the given URL. | 42 // Creates a new window and immediately loads the given URL. |
42 static CastWindowAndroid* CreateNewWindow( | 43 static CastWindowAndroid* CreateNewWindow( |
43 content::BrowserContext* browser_context, | 44 content::BrowserContext* browser_context, |
44 const GURL& url); | 45 const GURL& url); |
45 | 46 |
(...skipping 23 matching lines...) Expand all Loading... | |
69 const base::string16& message, | 70 const base::string16& message, |
70 int32 line_no, | 71 int32 line_no, |
71 const base::string16& source_id) override; | 72 const base::string16& source_id) override; |
72 virtual void ActivateContents(content::WebContents* contents) override; | 73 virtual void ActivateContents(content::WebContents* contents) override; |
73 virtual void DeactivateContents(content::WebContents* contents) override; | 74 virtual void DeactivateContents(content::WebContents* contents) override; |
74 | 75 |
75 // content::WebContentsObserver implementation: | 76 // content::WebContentsObserver implementation: |
76 virtual void RenderProcessGone(base::TerminationStatus status) override; | 77 virtual void RenderProcessGone(base::TerminationStatus status) override; |
77 | 78 |
78 private: | 79 private: |
79 explicit CastWindowAndroid(content::WebContents* web_contents); | 80 CastWindowAndroid(content::BrowserContext* browser_context); |
lcwu1
2015/02/04 00:28:31
Add 'explicit'.
gunsch
2015/02/04 00:38:36
Done.
| |
81 void Initialize(); | |
80 | 82 |
81 // Helper to create a new CastWindowAndroid given a newly created WebContents. | 83 content::BrowserContext* browser_context_; |
82 static CastWindowAndroid* CreateCastWindowAndroid( | |
83 content::WebContents* web_contents, | |
84 const gfx::Size& initial_size); | |
85 | |
86 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 84 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
87 scoped_ptr<content::WebContents> web_contents_; | 85 scoped_ptr<content::WebContents> web_contents_; |
86 scoped_ptr<CastContentWindow> window_; | |
88 | 87 |
89 base::WeakPtrFactory<CastWindowAndroid> weak_factory_; | 88 base::WeakPtrFactory<CastWindowAndroid> weak_factory_; |
90 | 89 |
91 DISALLOW_COPY_AND_ASSIGN(CastWindowAndroid); | 90 DISALLOW_COPY_AND_ASSIGN(CastWindowAndroid); |
92 }; | 91 }; |
93 | 92 |
94 } // namespace shell | 93 } // namespace shell |
95 } // namespace chromecast | 94 } // namespace chromecast |
96 | 95 |
97 #endif // CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_ | 96 #endif // CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_ |
OLD | NEW |