Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 3608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3619 | 3619 |
| 3620 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) { | 3620 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) { |
| 3621 if (delegate_ && rfh->GetRenderViewHost() == GetRenderViewHost()) | 3621 if (delegate_ && rfh->GetRenderViewHost() == GetRenderViewHost()) |
| 3622 delegate_->SwappedOut(this); | 3622 delegate_->SwappedOut(this); |
| 3623 } | 3623 } |
| 3624 | 3624 |
| 3625 void WebContentsImpl::DidDeferAfterResponseStarted( | 3625 void WebContentsImpl::DidDeferAfterResponseStarted( |
| 3626 const scoped_refptr<net::HttpResponseHeaders>& headers, | 3626 const scoped_refptr<net::HttpResponseHeaders>& headers, |
| 3627 const GURL& url) { | 3627 const GURL& url) { |
| 3628 #if defined(OS_ANDROID) | 3628 #if defined(OS_ANDROID) |
| 3629 ContentViewCoreImpl::FromWebContents(this)->DidDeferAfterResponseStarted( | 3629 WebContentsAndroid* web_contents_android = |
| 3630 headers, url); | 3630 static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey)); |
| 3631 if (!web_contents_android) { | |
| 3632 web_contents_android = new WebContentsAndroid(this); | |
| 3633 SetUserData(kWebContentsAndroidKey, web_contents_android); | |
| 3634 } | |
| 3635 web_contents_android->DidDeferAfterResponseStarted(headers, url);; | |
| 3631 #endif | 3636 #endif |
| 3632 } | 3637 } |
| 3633 | 3638 |
| 3634 bool WebContentsImpl::WillHandleDeferAfterResponseStarted() { | 3639 bool WebContentsImpl::WillHandleDeferAfterResponseStarted() { |
| 3635 #if defined(OS_ANDROID) | 3640 #if defined(OS_ANDROID) |
| 3636 return ContentViewCoreImpl::FromWebContents(this)-> | 3641 WebContentsAndroid* web_contents_android = |
| 3637 WillHandleDeferAfterResponseStarted(); | 3642 static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey)); |
| 3643 if (!web_contents_android) { | |
|
AKVT
2014/08/05 13:58:43
This part please correct if I added extra code.
| |
| 3644 web_contents_android = new WebContentsAndroid(this); | |
| 3645 SetUserData(kWebContentsAndroidKey, web_contents_android); | |
| 3646 } | |
| 3647 return web_contents_android->WillHandleDeferAfterResponseStarted(); | |
| 3638 #else | 3648 #else |
| 3639 return false; | 3649 return false; |
| 3640 #endif | 3650 #endif |
| 3641 } | 3651 } |
| 3642 | 3652 |
| 3643 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { | 3653 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { |
| 3644 if (delegate_ && delegate_->IsPopupOrPanel(this)) | 3654 if (delegate_ && delegate_->IsPopupOrPanel(this)) |
| 3645 delegate_->MoveContents(this, new_bounds); | 3655 delegate_->MoveContents(this, new_bounds); |
| 3646 } | 3656 } |
| 3647 | 3657 |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4245 if (new_size != old_size) | 4255 if (new_size != old_size) |
| 4246 delegate_->UpdatePreferredSize(this, new_size); | 4256 delegate_->UpdatePreferredSize(this, new_size); |
| 4247 } | 4257 } |
| 4248 | 4258 |
| 4249 void WebContentsImpl::ResumeResponseDeferredAtStart() { | 4259 void WebContentsImpl::ResumeResponseDeferredAtStart() { |
| 4250 FrameTreeNode* node = frame_tree_.root(); | 4260 FrameTreeNode* node = frame_tree_.root(); |
| 4251 node->render_manager()->ResumeResponseDeferredAtStart(); | 4261 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4252 } | 4262 } |
| 4253 | 4263 |
| 4254 } // namespace content | 4264 } // namespace content |
| OLD | NEW |