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

Side by Side Diff: android_webview/native/aw_contents.cc

Issue 2502763003: Introduce ViewRoot to forward input/view events to native (Closed)
Patch Set: WindowAndroid.GetEventHandler Created 4 years 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "android_webview/native/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "android_webview/browser/aw_browser_context.h" 10 #include "android_webview/browser/aw_browser_context.h"
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( 1248 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
1249 web_contents_->GetRenderProcessHost()->GetID(), url::kFileScheme); 1249 web_contents_->GetRenderProcessHost()->GetID(), url::kFileScheme);
1250 } 1250 }
1251 1251
1252 void AwContents::ResumeLoadingCreatedPopupWebContents( 1252 void AwContents::ResumeLoadingCreatedPopupWebContents(
1253 JNIEnv* env, 1253 JNIEnv* env,
1254 const JavaParamRef<jobject>& obj) { 1254 const JavaParamRef<jobject>& obj) {
1255 web_contents_->ResumeLoadingCreatedWebContents(); 1255 web_contents_->ResumeLoadingCreatedWebContents();
1256 } 1256 }
1257 1257
1258 jlong AwContents::GetNativeView(JNIEnv* env,
1259 const JavaParamRef<jobject>& obj) {
1260 return reinterpret_cast<intptr_t>(web_contents_->GetNativeView());
1261 }
1262
1258 void SetShouldDownloadFavicons(JNIEnv* env, 1263 void SetShouldDownloadFavicons(JNIEnv* env,
1259 const JavaParamRef<jclass>& jclazz) { 1264 const JavaParamRef<jclass>& jclazz) {
1260 g_should_download_favicons = true; 1265 g_should_download_favicons = true;
1261 } 1266 }
1262 1267
1263 void AwContents::RenderViewHostChanged(content::RenderViewHost* old_host, 1268 void AwContents::RenderViewHostChanged(content::RenderViewHost* old_host,
1264 content::RenderViewHost* new_host) { 1269 content::RenderViewHost* new_host) {
1265 DCHECK(new_host); 1270 DCHECK(new_host);
1266 1271
1267 int process_id = new_host->GetProcess()->GetID(); 1272 int process_id = new_host->GetProcess()->GetID();
1268 int routing_id = new_host->GetRoutingID(); 1273 int routing_id = new_host->GetRoutingID();
1269 // At this point, the current RVH may or may not contain a compositor. So 1274 // At this point, the current RVH may or may not contain a compositor. So
1270 // compositor_ may be nullptr, in which case 1275 // compositor_ may be nullptr, in which case
1271 // BrowserViewRenderer::DidInitializeCompositor() callback is time when the 1276 // BrowserViewRenderer::DidInitializeCompositor() callback is time when the
1272 // new compositor is constructed. 1277 // new compositor is constructed.
1273 browser_view_renderer_.SetActiveCompositorID( 1278 browser_view_renderer_.SetActiveCompositorID(
1274 CompositorID(process_id, routing_id)); 1279 CompositorID(process_id, routing_id));
1275 } 1280 }
1276 1281
1277 } // namespace android_webview 1282 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698