| 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_SHELL_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_ | 5 #ifndef CHROMECAST_SHELL_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_ |
| 6 #define CHROMECAST_SHELL_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_ | 6 #define CHROMECAST_SHELL_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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // Registers the JNI methods for CastWindowAndroid. | 55 // Registers the JNI methods for CastWindowAndroid. |
| 56 static bool RegisterJni(JNIEnv* env); | 56 static bool RegisterJni(JNIEnv* env); |
| 57 | 57 |
| 58 // content::WebContentsDelegate implementation: | 58 // content::WebContentsDelegate implementation: |
| 59 virtual void AddNewContents(content::WebContents* source, | 59 virtual void AddNewContents(content::WebContents* source, |
| 60 content::WebContents* new_contents, | 60 content::WebContents* new_contents, |
| 61 WindowOpenDisposition disposition, | 61 WindowOpenDisposition disposition, |
| 62 const gfx::Rect& initial_pos, | 62 const gfx::Rect& initial_pos, |
| 63 bool user_gesture, | 63 bool user_gesture, |
| 64 bool* was_blocked) OVERRIDE; | 64 bool* was_blocked) override; |
| 65 virtual void CloseContents(content::WebContents* source) OVERRIDE; | 65 virtual void CloseContents(content::WebContents* source) override; |
| 66 virtual bool CanOverscrollContent() const OVERRIDE; | 66 virtual bool CanOverscrollContent() const override; |
| 67 virtual bool AddMessageToConsole(content::WebContents* source, | 67 virtual bool AddMessageToConsole(content::WebContents* source, |
| 68 int32 level, | 68 int32 level, |
| 69 const base::string16& message, | 69 const base::string16& message, |
| 70 int32 line_no, | 70 int32 line_no, |
| 71 const base::string16& source_id) OVERRIDE; | 71 const base::string16& source_id) override; |
| 72 virtual void ActivateContents(content::WebContents* contents) OVERRIDE; | 72 virtual void ActivateContents(content::WebContents* contents) override; |
| 73 virtual void DeactivateContents(content::WebContents* contents) OVERRIDE; | 73 virtual void DeactivateContents(content::WebContents* contents) override; |
| 74 | 74 |
| 75 // content::WebContentsObserver implementation: | 75 // content::WebContentsObserver implementation: |
| 76 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 76 virtual void RenderProcessGone(base::TerminationStatus status) override; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 explicit CastWindowAndroid(content::WebContents* web_contents); | 79 explicit CastWindowAndroid(content::WebContents* web_contents); |
| 80 | 80 |
| 81 // Helper to create a new CastWindowAndroid given a newly created WebContents. | 81 // Helper to create a new CastWindowAndroid given a newly created WebContents. |
| 82 static CastWindowAndroid* CreateCastWindowAndroid( | 82 static CastWindowAndroid* CreateCastWindowAndroid( |
| 83 content::WebContents* web_contents, | 83 content::WebContents* web_contents, |
| 84 const gfx::Size& initial_size); | 84 const gfx::Size& initial_size); |
| 85 | 85 |
| 86 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 86 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 87 scoped_ptr<content::WebContents> web_contents_; | 87 scoped_ptr<content::WebContents> web_contents_; |
| 88 | 88 |
| 89 base::WeakPtrFactory<CastWindowAndroid> weak_factory_; | 89 base::WeakPtrFactory<CastWindowAndroid> weak_factory_; |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(CastWindowAndroid); | 91 DISALLOW_COPY_AND_ASSIGN(CastWindowAndroid); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace shell | 94 } // namespace shell |
| 95 } // namespace chromecast | 95 } // namespace chromecast |
| 96 | 96 |
| 97 #endif // CHROMECAST_SHELL_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_ | 97 #endif // CHROMECAST_SHELL_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_ |
| OLD | NEW |