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

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: Removed NavigationTransitionDelegate interface from ContentViewCore. 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 9c40100612d6022542c28706a618ade5f8abd5e0..a1db1c788f49d0d9beee27c2458c32947557bf8b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2436,8 +2436,13 @@ 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 =
Yaron 2014/08/07 01:20:44 Please extract a helper function and place alongsi
AKVT 2014/08/07 07:37:06 Done.
+ static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey));
+ if (!web_contents_android) {
+ web_contents_android = new WebContentsAndroid(this);
+ SetUserData(kWebContentsAndroidKey, web_contents_android);
+ }
+ web_contents_android->DidStartNavigationTransitionForFrame(render_frame_id);
#endif
}
@@ -3626,15 +3631,26 @@ 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 =
+ static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey));
+ if (!web_contents_android) {
+ web_contents_android = new WebContentsAndroid(this);
+ SetUserData(kWebContentsAndroidKey, web_contents_android);
+ }
+ web_contents_android->DidDeferAfterResponseStarted(headers, url);
+ ;
Yaron 2014/08/07 01:20:44 remove
AKVT 2014/08/07 07:37:06 Done.
#endif
}
bool WebContentsImpl::WillHandleDeferAfterResponseStarted() {
#if defined(OS_ANDROID)
- return ContentViewCoreImpl::FromWebContents(this)->
- WillHandleDeferAfterResponseStarted();
+ 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->WillHandleDeferAfterResponseStarted();
#else
return false;
#endif

Powered by Google App Engine
This is Rietveld 408576698