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 #include "chromecast/browser/android/cast_window_android.h" | 5 #include "chromecast/browser/android/cast_window_android.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "chromecast/browser/android/cast_window_manager.h" | 8 #include "chromecast/browser/android/cast_window_manager.h" |
9 #include "chromecast/browser/cast_content_window.h" | 9 #include "chromecast/browser/cast_content_window.h" |
10 #include "content/public/browser/devtools_agent_host.h" | 10 #include "content/public/browser/devtools_agent_host.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 content::WebContentsObserver::Observe(web_contents_.get()); | 65 content::WebContentsObserver::Observe(web_contents_.get()); |
66 | 66 |
67 JNIEnv* env = base::android::AttachCurrentThread(); | 67 JNIEnv* env = base::android::AttachCurrentThread(); |
68 window_java_.Reset(CreateCastWindowView(this)); | 68 window_java_.Reset(CreateCastWindowView(this)); |
69 | 69 |
70 Java_CastWindowAndroid_initFromNativeWebContents( | 70 Java_CastWindowAndroid_initFromNativeWebContents( |
71 env, window_java_.obj(), web_contents_->GetJavaWebContents().obj(), | 71 env, window_java_.obj(), web_contents_->GetJavaWebContents().obj(), |
72 web_contents_->GetRenderProcessHost()->GetID()); | 72 web_contents_->GetRenderProcessHost()->GetID()); |
73 | 73 |
74 // Enabling hole-punching also requires runtime renderer preference | 74 // Enabling hole-punching also requires runtime renderer preference |
75 web_contents_->GetMutableRendererPrefs()-> | 75 content::RendererPreferences* prefs = |
76 use_video_overlay_for_embedded_encrypted_video = true; | 76 web_contents_->GetMutableRendererPrefs(); |
| 77 prefs->use_video_overlay_for_embedded_encrypted_video = true; |
| 78 prefs->use_view_overlay_for_all_video = true; |
77 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); | 79 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); |
78 } | 80 } |
79 | 81 |
80 CastWindowAndroid::~CastWindowAndroid() { | 82 CastWindowAndroid::~CastWindowAndroid() { |
81 } | 83 } |
82 | 84 |
83 void CastWindowAndroid::Close() { | 85 void CastWindowAndroid::Close() { |
84 // Close page first, which fires the window.unload event. The WebContents | 86 // Close page first, which fires the window.unload event. The WebContents |
85 // itself will be destroyed after browser-process has received renderer | 87 // itself will be destroyed after browser-process has received renderer |
86 // notification that the page is closed. | 88 // notification that the page is closed. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 contents->GetRenderViewHost()->Blur(); | 153 contents->GetRenderViewHost()->Blur(); |
152 } | 154 } |
153 | 155 |
154 void CastWindowAndroid::RenderProcessGone(base::TerminationStatus status) { | 156 void CastWindowAndroid::RenderProcessGone(base::TerminationStatus status) { |
155 LOG(ERROR) << "Render process gone: status=" << status; | 157 LOG(ERROR) << "Render process gone: status=" << status; |
156 Destroy(); | 158 Destroy(); |
157 } | 159 } |
158 | 160 |
159 } // namespace shell | 161 } // namespace shell |
160 } // namespace chromecast | 162 } // namespace chromecast |
OLD | NEW |