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

Side by Side 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 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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2429 observers_, 2429 observers_,
2430 ProvisionalChangeToMainFrameUrl(validated_url, 2430 ProvisionalChangeToMainFrameUrl(validated_url,
2431 render_frame_host)); 2431 render_frame_host));
2432 } 2432 }
2433 } 2433 }
2434 2434
2435 void WebContentsImpl::DidStartNavigationTransition( 2435 void WebContentsImpl::DidStartNavigationTransition(
2436 RenderFrameHostImpl* render_frame_host) { 2436 RenderFrameHostImpl* render_frame_host) {
2437 #if defined(OS_ANDROID) 2437 #if defined(OS_ANDROID)
2438 int render_frame_id = render_frame_host->GetRoutingID(); 2438 int render_frame_id = render_frame_host->GetRoutingID();
2439 ContentViewCoreImpl::FromWebContents(this)-> 2439 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.
2440 DidStartNavigationTransitionForFrame(render_frame_id); 2440 static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey));
2441 if (!web_contents_android) {
2442 web_contents_android = new WebContentsAndroid(this);
2443 SetUserData(kWebContentsAndroidKey, web_contents_android);
2444 }
2445 web_contents_android->DidStartNavigationTransitionForFrame(render_frame_id);
2441 #endif 2446 #endif
2442 } 2447 }
2443 2448
2444 void WebContentsImpl::DidFailProvisionalLoadWithError( 2449 void WebContentsImpl::DidFailProvisionalLoadWithError(
2445 RenderFrameHostImpl* render_frame_host, 2450 RenderFrameHostImpl* render_frame_host,
2446 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { 2451 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {
2447 GURL validated_url(params.url); 2452 GURL validated_url(params.url);
2448 FOR_EACH_OBSERVER(WebContentsObserver, 2453 FOR_EACH_OBSERVER(WebContentsObserver,
2449 observers_, 2454 observers_,
2450 DidFailProvisionalLoad(render_frame_host, 2455 DidFailProvisionalLoad(render_frame_host,
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
3619 3624
3620 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) { 3625 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) {
3621 if (delegate_ && rfh->GetRenderViewHost() == GetRenderViewHost()) 3626 if (delegate_ && rfh->GetRenderViewHost() == GetRenderViewHost())
3622 delegate_->SwappedOut(this); 3627 delegate_->SwappedOut(this);
3623 } 3628 }
3624 3629
3625 void WebContentsImpl::DidDeferAfterResponseStarted( 3630 void WebContentsImpl::DidDeferAfterResponseStarted(
3626 const scoped_refptr<net::HttpResponseHeaders>& headers, 3631 const scoped_refptr<net::HttpResponseHeaders>& headers,
3627 const GURL& url) { 3632 const GURL& url) {
3628 #if defined(OS_ANDROID) 3633 #if defined(OS_ANDROID)
3629 ContentViewCoreImpl::FromWebContents(this)->DidDeferAfterResponseStarted( 3634 WebContentsAndroid* web_contents_android =
3630 headers, url); 3635 static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey));
3636 if (!web_contents_android) {
3637 web_contents_android = new WebContentsAndroid(this);
3638 SetUserData(kWebContentsAndroidKey, web_contents_android);
3639 }
3640 web_contents_android->DidDeferAfterResponseStarted(headers, url);
3641 ;
Yaron 2014/08/07 01:20:44 remove
AKVT 2014/08/07 07:37:06 Done.
3631 #endif 3642 #endif
3632 } 3643 }
3633 3644
3634 bool WebContentsImpl::WillHandleDeferAfterResponseStarted() { 3645 bool WebContentsImpl::WillHandleDeferAfterResponseStarted() {
3635 #if defined(OS_ANDROID) 3646 #if defined(OS_ANDROID)
3636 return ContentViewCoreImpl::FromWebContents(this)-> 3647 WebContentsAndroid* web_contents_android =
3637 WillHandleDeferAfterResponseStarted(); 3648 static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey));
3649 if (!web_contents_android) {
3650 web_contents_android = new WebContentsAndroid(this);
3651 SetUserData(kWebContentsAndroidKey, web_contents_android);
3652 }
3653 return web_contents_android->WillHandleDeferAfterResponseStarted();
3638 #else 3654 #else
3639 return false; 3655 return false;
3640 #endif 3656 #endif
3641 } 3657 }
3642 3658
3643 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { 3659 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) {
3644 if (delegate_ && delegate_->IsPopupOrPanel(this)) 3660 if (delegate_ && delegate_->IsPopupOrPanel(this))
3645 delegate_->MoveContents(this, new_bounds); 3661 delegate_->MoveContents(this, new_bounds);
3646 } 3662 }
3647 3663
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
4245 if (new_size != old_size) 4261 if (new_size != old_size)
4246 delegate_->UpdatePreferredSize(this, new_size); 4262 delegate_->UpdatePreferredSize(this, new_size);
4247 } 4263 }
4248 4264
4249 void WebContentsImpl::ResumeResponseDeferredAtStart() { 4265 void WebContentsImpl::ResumeResponseDeferredAtStart() {
4250 FrameTreeNode* node = frame_tree_.root(); 4266 FrameTreeNode* node = frame_tree_.root();
4251 node->render_manager()->ResumeResponseDeferredAtStart(); 4267 node->render_manager()->ResumeResponseDeferredAtStart();
4252 } 4268 }
4253 4269
4254 } // namespace content 4270 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698