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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 414423002: Removing ContentViewCore dependencies from few functions which acts as direct wrapper to WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted native file changes to correct inclusion order. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index b40774f564202ba9f137a2a36546dcea6b74e130..489da7cc27a9a716af8fd70f8fe8138f339d8477 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2435,8 +2435,8 @@ void WebContentsImpl::DidStartNavigationTransition(
RenderFrameHostImpl* render_frame_host) {
#if defined(OS_ANDROID)
int render_frame_id = render_frame_host->GetRoutingID();
- ContentViewCoreImpl::FromWebContents(this)->
- DidStartNavigationTransitionForFrame(render_frame_id);
+ WebContentsAndroid* web_contents_android = GetWebContentsAndroid();
+ web_contents_android->DidStartNavigationTransitionForFrame(render_frame_id);
sky 2014/08/07 16:17:31 I wouldn't bother with the local variable for WebC
AKVT 2014/08/08 15:08:25 Removed Local variable. Thanks
#endif
}
@@ -3605,15 +3605,15 @@ void WebContentsImpl::DidDeferAfterResponseStarted(
const scoped_refptr<net::HttpResponseHeaders>& headers,
const GURL& url) {
#if defined(OS_ANDROID)
- ContentViewCoreImpl::FromWebContents(this)->DidDeferAfterResponseStarted(
- headers, url);
+ WebContentsAndroid* web_contents_android = GetWebContentsAndroid();
+ web_contents_android->DidDeferAfterResponseStarted(headers, url);
#endif
}
bool WebContentsImpl::WillHandleDeferAfterResponseStarted() {
#if defined(OS_ANDROID)
- return ContentViewCoreImpl::FromWebContents(this)->
- WillHandleDeferAfterResponseStarted();
+ WebContentsAndroid* web_contents_android = GetWebContentsAndroid();
+ return web_contents_android->WillHandleDeferAfterResponseStarted();
#else
return false;
#endif
@@ -4099,13 +4099,18 @@ base::android::ScopedJavaLocalRef<jobject>
WebContentsImpl::GetJavaWebContents() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ WebContentsAndroid* web_contents_android = GetWebContentsAndroid();
+ return web_contents_android->GetJavaObject();
+}
+
+WebContentsAndroid* WebContentsImpl::GetWebContentsAndroid() {
sky 2014/08/07 16:17:31 Make position match header.
AKVT 2014/08/08 15:08:25 Positioned the declaration immediately after GetJa
WebContentsAndroid* web_contents_android =
static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey));
if (!web_contents_android) {
web_contents_android = new WebContentsAndroid(this);
SetUserData(kWebContentsAndroidKey, web_contents_android);
}
- return web_contents_android->GetJavaObject();
+ return web_contents_android;
}
bool WebContentsImpl::CreateRenderViewForInitialEmptyDocument() {

Powered by Google App Engine
This is Rietveld 408576698