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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1749 this, new_contents, params.disposition, initial_rect, | 1749 this, new_contents, params.disposition, initial_rect, |
1750 params.user_gesture, &was_blocked); | 1750 params.user_gesture, &was_blocked); |
1751 } | 1751 } |
1752 if (!was_blocked) { | 1752 if (!was_blocked) { |
1753 OpenURLParams open_params(params.target_url, | 1753 OpenURLParams open_params(params.target_url, |
1754 Referrer(), | 1754 Referrer(), |
1755 CURRENT_TAB, | 1755 CURRENT_TAB, |
1756 ui::PAGE_TRANSITION_LINK, | 1756 ui::PAGE_TRANSITION_LINK, |
1757 true /* is_renderer_initiated */); | 1757 true /* is_renderer_initiated */); |
1758 open_params.user_gesture = params.user_gesture; | 1758 open_params.user_gesture = params.user_gesture; |
1759 new_contents->OpenURL(open_params); | 1759 |
1760 if (delegate_ && !is_guest && | |
1761 !delegate_->ShouldResumeRequestsForCreatedWindow()) { | |
1762 // We are in asynchronous add new contents path, delay opening url | |
1763 new_contents->delayed_open_url_params_.reset( | |
1764 new OpenURLParams(open_params)); | |
1765 } else { | |
1766 new_contents->OpenURL(open_params); | |
1767 } | |
1760 } | 1768 } |
1761 } | 1769 } |
1762 } | 1770 } |
1763 | 1771 |
1764 void WebContentsImpl::CreateNewWidget(int render_process_id, | 1772 void WebContentsImpl::CreateNewWidget(int render_process_id, |
1765 int route_id, | 1773 int route_id, |
1766 blink::WebPopupType popup_type) { | 1774 blink::WebPopupType popup_type) { |
1767 CreateNewWidget(render_process_id, route_id, false, popup_type); | 1775 CreateNewWidget(render_process_id, route_id, false, popup_type); |
1768 } | 1776 } |
1769 | 1777 |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2662 manifest_manager_host_->GetManifest(GetMainFrame(), callback); | 2670 manifest_manager_host_->GetManifest(GetMainFrame(), callback); |
2663 } | 2671 } |
2664 | 2672 |
2665 void WebContentsImpl::ExitFullscreen() { | 2673 void WebContentsImpl::ExitFullscreen() { |
2666 // Clean up related state and initiate the fullscreen exit. | 2674 // Clean up related state and initiate the fullscreen exit. |
2667 GetRenderViewHost()->RejectMouseLockOrUnlockIfNecessary(); | 2675 GetRenderViewHost()->RejectMouseLockOrUnlockIfNecessary(); |
2668 ExitFullscreenMode(); | 2676 ExitFullscreenMode(); |
2669 } | 2677 } |
2670 | 2678 |
2671 void WebContentsImpl::ResumeLoadingCreatedWebContents() { | 2679 void WebContentsImpl::ResumeLoadingCreatedWebContents() { |
2680 if (delayed_open_url_params_.get()) { | |
2681 OpenURL(*delayed_open_url_params_.get()); | |
2682 delayed_open_url_params_.reset(nullptr); | |
2683 return; | |
nasko
2015/07/10 07:42:20
Why is there a return here? Skipping the initializ
Maria
2015/07/10 16:26:25
This function is not called in the initialization
| |
2684 } | |
2685 | |
2672 // Resume blocked requests for both the RenderViewHost and RenderFrameHost. | 2686 // Resume blocked requests for both the RenderViewHost and RenderFrameHost. |
2673 // TODO(brettw): It seems bogus to reach into here and initialize the host. | 2687 // TODO(brettw): It seems bogus to reach into here and initialize the host. |
2674 GetRenderViewHost()->Init(); | 2688 GetRenderViewHost()->Init(); |
2675 GetMainFrame()->Init(); | 2689 GetMainFrame()->Init(); |
2676 } | 2690 } |
2677 | 2691 |
2678 bool WebContentsImpl::FocusLocationBarByDefault() { | 2692 bool WebContentsImpl::FocusLocationBarByDefault() { |
2679 NavigationEntry* entry = controller_.GetVisibleEntry(); | 2693 NavigationEntry* entry = controller_.GetVisibleEntry(); |
2680 if (entry && entry->GetURL() == GURL(url::kAboutBlankURL)) | 2694 if (entry && entry->GetURL() == GURL(url::kAboutBlankURL)) |
2681 return true; | 2695 return true; |
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4491 player_map->erase(it); | 4505 player_map->erase(it); |
4492 } | 4506 } |
4493 | 4507 |
4494 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4508 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4495 force_disable_overscroll_content_ = force_disable; | 4509 force_disable_overscroll_content_ = force_disable; |
4496 if (view_) | 4510 if (view_) |
4497 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4511 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4498 } | 4512 } |
4499 | 4513 |
4500 } // namespace content | 4514 } // namespace content |
OLD | NEW |