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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 #include "net/http/http_transaction_factory.h" | 90 #include "net/http/http_transaction_factory.h" |
91 #include "net/url_request/url_request_context.h" | 91 #include "net/url_request/url_request_context.h" |
92 #include "net/url_request/url_request_context_getter.h" | 92 #include "net/url_request/url_request_context_getter.h" |
93 #include "ui/base/layout.h" | 93 #include "ui/base/layout.h" |
94 #include "ui/gfx/display.h" | 94 #include "ui/gfx/display.h" |
95 #include "ui/gfx/screen.h" | 95 #include "ui/gfx/screen.h" |
96 #include "ui/gl/gl_switches.h" | 96 #include "ui/gl/gl_switches.h" |
97 #include "webkit/common/webpreferences.h" | 97 #include "webkit/common/webpreferences.h" |
98 | 98 |
99 #if defined(OS_ANDROID) | 99 #if defined(OS_ANDROID) |
| 100 #include "content/browser/android/content_view_core_impl.h" |
100 #include "content/browser/android/date_time_chooser_android.h" | 101 #include "content/browser/android/date_time_chooser_android.h" |
101 #include "content/browser/media/android/browser_media_player_manager.h" | 102 #include "content/browser/media/android/browser_media_player_manager.h" |
102 #include "content/browser/web_contents/web_contents_android.h" | 103 #include "content/browser/web_contents/web_contents_android.h" |
103 #include "content/public/browser/android/content_view_core.h" | 104 #include "content/public/browser/android/content_view_core.h" |
104 #endif | 105 #endif |
105 | 106 |
106 #if defined(OS_MACOSX) | 107 #if defined(OS_MACOSX) |
107 #include "base/mac/foundation_util.h" | 108 #include "base/mac/foundation_util.h" |
108 #endif | 109 #endif |
109 | 110 |
(...skipping 3364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3474 // Ignore this if it comes from a RenderViewHost that we aren't showing. | 3475 // Ignore this if it comes from a RenderViewHost that we aren't showing. |
3475 if (delegate_ && rvh == GetRenderViewHost()) | 3476 if (delegate_ && rvh == GetRenderViewHost()) |
3476 delegate_->CloseContents(this); | 3477 delegate_->CloseContents(this); |
3477 } | 3478 } |
3478 | 3479 |
3479 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) { | 3480 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) { |
3480 if (delegate_ && rfh->GetRenderViewHost() == GetRenderViewHost()) | 3481 if (delegate_ && rfh->GetRenderViewHost() == GetRenderViewHost()) |
3481 delegate_->SwappedOut(this); | 3482 delegate_->SwappedOut(this); |
3482 } | 3483 } |
3483 | 3484 |
| 3485 void WebContentsImpl::DidDeferAfterResponseStarted() { |
| 3486 #if defined(OS_ANDROID) |
| 3487 ContentViewCoreImpl::FromWebContents(this)->DidDeferAfterResponseStarted(); |
| 3488 #endif |
| 3489 } |
| 3490 |
| 3491 bool WebContentsImpl::WillHandleDeferAfterResponseStarted() { |
| 3492 #if defined(OS_ANDROID) |
| 3493 return ContentViewCoreImpl::FromWebContents(this)-> |
| 3494 WillHandleDeferAfterResponseStarted(); |
| 3495 #else |
| 3496 return false; |
| 3497 #endif |
| 3498 } |
| 3499 |
3484 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { | 3500 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { |
3485 if (delegate_ && delegate_->IsPopupOrPanel(this)) | 3501 if (delegate_ && delegate_->IsPopupOrPanel(this)) |
3486 delegate_->MoveContents(this, new_bounds); | 3502 delegate_->MoveContents(this, new_bounds); |
3487 } | 3503 } |
3488 | 3504 |
3489 void WebContentsImpl::DidStartLoading(RenderFrameHost* render_frame_host, | 3505 void WebContentsImpl::DidStartLoading(RenderFrameHost* render_frame_host, |
3490 bool to_different_document) { | 3506 bool to_different_document) { |
3491 SetIsLoading(render_frame_host->GetRenderViewHost(), true, | 3507 SetIsLoading(render_frame_host->GetRenderViewHost(), true, |
3492 to_different_document, NULL); | 3508 to_different_document, NULL); |
3493 } | 3509 } |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4078 } | 4094 } |
4079 | 4095 |
4080 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 4096 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
4081 if (!delegate_) | 4097 if (!delegate_) |
4082 return; | 4098 return; |
4083 const gfx::Size new_size = GetPreferredSize(); | 4099 const gfx::Size new_size = GetPreferredSize(); |
4084 if (new_size != old_size) | 4100 if (new_size != old_size) |
4085 delegate_->UpdatePreferredSize(this, new_size); | 4101 delegate_->UpdatePreferredSize(this, new_size); |
4086 } | 4102 } |
4087 | 4103 |
| 4104 void WebContentsImpl::ResumeResponseDeferredAtStart() { |
| 4105 FrameTreeNode* node = frame_tree_.root(); |
| 4106 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4107 } |
| 4108 |
4088 } // namespace content | 4109 } // namespace content |
OLD | NEW |