Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chromecast/browser/android/cast_window_android.h

Issue 874683006: Chromecast: makes CastWindowAndroid use CastContentWindow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change ScopedJavaLocalRef behavior Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chromecast/browser/android/cast_window_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 explicit CastWindowAndroid(content::BrowserContext* browser_context);
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( 84 base::android::ScopedJavaGlobalRef<jobject> window_java_;
83 content::WebContents* web_contents,
84 const gfx::Size& initial_size);
85
86 base::android::ScopedJavaGlobalRef<jobject> java_object_;
87 scoped_ptr<content::WebContents> web_contents_; 85 scoped_ptr<content::WebContents> web_contents_;
86 scoped_ptr<CastContentWindow> content_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_
OLDNEW
« no previous file with comments | « no previous file | chromecast/browser/android/cast_window_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698