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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 #include "net/http/http_transaction_factory.h" | 88 #include "net/http/http_transaction_factory.h" |
89 #include "net/url_request/url_request_context.h" | 89 #include "net/url_request/url_request_context.h" |
90 #include "net/url_request/url_request_context_getter.h" | 90 #include "net/url_request/url_request_context_getter.h" |
91 #include "ui/base/layout.h" | 91 #include "ui/base/layout.h" |
92 #include "ui/gfx/display.h" | 92 #include "ui/gfx/display.h" |
93 #include "ui/gfx/screen.h" | 93 #include "ui/gfx/screen.h" |
94 #include "ui/gl/gl_switches.h" | 94 #include "ui/gl/gl_switches.h" |
95 #include "webkit/common/webpreferences.h" | 95 #include "webkit/common/webpreferences.h" |
96 | 96 |
97 #if defined(OS_ANDROID) | 97 #if defined(OS_ANDROID) |
98 #include "content/browser/android/content_view_core_impl.h" | |
98 #include "content/browser/android/date_time_chooser_android.h" | 99 #include "content/browser/android/date_time_chooser_android.h" |
99 #include "content/browser/media/android/browser_media_player_manager.h" | 100 #include "content/browser/media/android/browser_media_player_manager.h" |
100 #include "content/browser/web_contents/web_contents_android.h" | 101 #include "content/browser/web_contents/web_contents_android.h" |
101 #include "content/public/browser/android/content_view_core.h" | 102 #include "content/public/browser/android/content_view_core.h" |
102 #endif | 103 #endif |
103 | 104 |
104 #if defined(OS_MACOSX) | 105 #if defined(OS_MACOSX) |
105 #include "base/mac/foundation_util.h" | 106 #include "base/mac/foundation_util.h" |
106 #include "ui/gl/io_surface_support_mac.h" | 107 #include "ui/gl/io_surface_support_mac.h" |
107 #endif | 108 #endif |
(...skipping 3362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3470 // Ignore this if it comes from a RenderViewHost that we aren't showing. | 3471 // Ignore this if it comes from a RenderViewHost that we aren't showing. |
3471 if (delegate_ && rvh == GetRenderViewHost()) | 3472 if (delegate_ && rvh == GetRenderViewHost()) |
3472 delegate_->CloseContents(this); | 3473 delegate_->CloseContents(this); |
3473 } | 3474 } |
3474 | 3475 |
3475 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) { | 3476 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) { |
3476 if (delegate_ && rfh->GetRenderViewHost() == GetRenderViewHost()) | 3477 if (delegate_ && rfh->GetRenderViewHost() == GetRenderViewHost()) |
3477 delegate_->SwappedOut(this); | 3478 delegate_->SwappedOut(this); |
3478 } | 3479 } |
3479 | 3480 |
3481 void WebContentsImpl::DidDeferAfterResponseStarted() { | |
3482 if (!did_defer_callback_for_testing_.is_null()) { | |
3483 did_defer_callback_for_testing_.Run(); | |
3484 return; | |
3485 } | |
3486 | |
3487 #if defined(OS_ANDROID) | |
3488 ContentViewCoreImpl::FromWebContents(this)->DidDeferAfterResponseStarted(); | |
3489 #endif | |
3490 } | |
3491 | |
3492 bool WebContentsImpl::WillHandleDeferAfterResponseStarted() { | |
3493 if (!did_defer_callback_for_testing_.is_null()) | |
3494 return true; | |
jam
2014/06/16 03:46:10
why are you stopping the code below from running i
shatch
2014/06/16 22:32:19
Figured for the test we already know we want to th
jam
2014/06/16 23:08:33
Can you explain this to me some more? I think you'
| |
3495 #if defined(OS_ANDROID) | |
3496 return ContentViewCoreImpl::FromWebContents(this)-> | |
3497 WillHandleDeferAfterResponseStarted(); | |
3498 #else | |
3499 return false; | |
3500 #endif | |
3501 } | |
3502 | |
3480 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { | 3503 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { |
3481 if (delegate_ && delegate_->IsPopupOrPanel(this)) | 3504 if (delegate_ && delegate_->IsPopupOrPanel(this)) |
3482 delegate_->MoveContents(this, new_bounds); | 3505 delegate_->MoveContents(this, new_bounds); |
3483 } | 3506 } |
3484 | 3507 |
3485 void WebContentsImpl::DidStartLoading(RenderFrameHost* render_frame_host, | 3508 void WebContentsImpl::DidStartLoading(RenderFrameHost* render_frame_host, |
3486 bool to_different_document) { | 3509 bool to_different_document) { |
3487 SetIsLoading(render_frame_host->GetRenderViewHost(), true, | 3510 SetIsLoading(render_frame_host->GetRenderViewHost(), true, |
3488 to_different_document, NULL); | 3511 to_different_document, NULL); |
3489 } | 3512 } |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4074 } | 4097 } |
4075 | 4098 |
4076 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 4099 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
4077 if (!delegate_) | 4100 if (!delegate_) |
4078 return; | 4101 return; |
4079 const gfx::Size new_size = GetPreferredSize(); | 4102 const gfx::Size new_size = GetPreferredSize(); |
4080 if (new_size != old_size) | 4103 if (new_size != old_size) |
4081 delegate_->UpdatePreferredSize(this, new_size); | 4104 delegate_->UpdatePreferredSize(this, new_size); |
4082 } | 4105 } |
4083 | 4106 |
4107 void WebContentsImpl::ResumeResponseDeferredAtStart() { | |
4108 FrameTreeNode* node = frame_tree_.root(); | |
4109 node->render_manager()->ResumeResponseDeferredAtStart(); | |
4110 } | |
4111 | |
4084 } // namespace content | 4112 } // namespace content |
OLD | NEW |