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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 12443003: Implement out-of-band video compositing on Android: Step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit2 Created 7 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/json/json_writer.h" 12 #include "base/json/json_writer.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "cc/layer.h" 16 #include "cc/layer.h"
17 #include "content/browser/android/external_video_surface_view_holder.h"
17 #include "content/browser/android/interstitial_page_delegate_android.h" 18 #include "content/browser/android/interstitial_page_delegate_android.h"
18 #include "content/browser/android/load_url_params.h" 19 #include "content/browser/android/load_url_params.h"
20 #include "content/browser/android/media_player_manager_android.h"
19 #include "content/browser/android/touch_point.h" 21 #include "content/browser/android/touch_point.h"
20 #include "content/browser/renderer_host/java/java_bound_object.h" 22 #include "content/browser/renderer_host/java/java_bound_object.h"
21 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager .h" 23 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager .h"
22 #include "content/browser/renderer_host/compositor_impl_android.h" 24 #include "content/browser/renderer_host/compositor_impl_android.h"
23 #include "content/browser/renderer_host/render_view_host_impl.h" 25 #include "content/browser/renderer_host/render_view_host_impl.h"
24 #include "content/browser/renderer_host/render_widget_host_impl.h" 26 #include "content/browser/renderer_host/render_widget_host_impl.h"
25 #include "content/browser/renderer_host/render_widget_host_view_android.h" 27 #include "content/browser/renderer_host/render_widget_host_view_android.h"
26 #include "content/browser/ssl/ssl_host_state.h" 28 #include "content/browser/ssl/ssl_host_state.h"
27 #include "content/browser/web_contents/interstitial_page_impl.h" 29 #include "content/browser/web_contents/interstitial_page_impl.h"
28 #include "content/browser/web_contents/navigation_controller_impl.h" 30 #include "content/browser/web_contents/navigation_controller_impl.h"
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 bool enable) { 1177 bool enable) {
1176 RenderViewHost* host = web_contents_->GetRenderViewHost(); 1178 RenderViewHost* host = web_contents_->GetRenderViewHost();
1177 host->Send(new ViewMsg_EnableHidingTopControls(host->GetRoutingID(), enable)); 1179 host->Send(new ViewMsg_EnableHidingTopControls(host->GetRoutingID(), enable));
1178 } 1180 }
1179 1181
1180 void ContentViewCoreImpl::ShowImeIfNeeded(JNIEnv* env, jobject obj) { 1182 void ContentViewCoreImpl::ShowImeIfNeeded(JNIEnv* env, jobject obj) {
1181 RenderViewHost* host = web_contents_->GetRenderViewHost(); 1183 RenderViewHost* host = web_contents_->GetRenderViewHost();
1182 host->Send(new ViewMsg_ShowImeIfNeeded(host->GetRoutingID())); 1184 host->Send(new ViewMsg_ShowImeIfNeeded(host->GetRoutingID()));
1183 } 1185 }
1184 1186
1187 void ContentViewCoreImpl::SetExternalVideoSurfaceViewHolder(
1188 JNIEnv* env, jobject obj, jint native_holder) {
1189 ExternalVideoSurfaceViewHolder* holder =
1190 reinterpret_cast<ExternalVideoSurfaceViewHolder*>(native_holder);
1191
1192 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(
1193 web_contents_->GetRenderViewHost());
1194 if (rvhi && rvhi->media_player_manager())
1195 rvhi->media_player_manager()->SetExternalVideoSurfaceViewHolder(holder);
1196 }
1197
1185 void ContentViewCoreImpl::ScrollFocusedEditableNodeIntoView(JNIEnv* env, 1198 void ContentViewCoreImpl::ScrollFocusedEditableNodeIntoView(JNIEnv* env,
1186 jobject obj) { 1199 jobject obj) {
1187 RenderViewHost* host = web_contents_->GetRenderViewHost(); 1200 RenderViewHost* host = web_contents_->GetRenderViewHost();
1188 host->Send(new ViewMsg_ScrollFocusedEditableNodeIntoRect(host->GetRoutingID(), 1201 host->Send(new ViewMsg_ScrollFocusedEditableNodeIntoRect(host->GetRoutingID(),
1189 gfx::Rect())); 1202 gfx::Rect()));
1190 } 1203 }
1191 1204
1192 namespace { 1205 namespace {
1193 1206
1194 static void AddNavigationEntryToHistory(JNIEnv* env, jobject obj, 1207 static void AddNavigationEntryToHistory(JNIEnv* env, jobject obj,
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 reinterpret_cast<WebContents*>(native_web_contents), 1404 reinterpret_cast<WebContents*>(native_web_contents),
1392 reinterpret_cast<ui::WindowAndroid*>(native_window)); 1405 reinterpret_cast<ui::WindowAndroid*>(native_window));
1393 return reinterpret_cast<jint>(view); 1406 return reinterpret_cast<jint>(view);
1394 } 1407 }
1395 1408
1396 bool RegisterContentViewCore(JNIEnv* env) { 1409 bool RegisterContentViewCore(JNIEnv* env) {
1397 return RegisterNativesImpl(env); 1410 return RegisterNativesImpl(env);
1398 } 1411 }
1399 1412
1400 } // namespace content 1413 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698