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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 3249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3260 } | 3260 } |
3261 | 3261 |
3262 void WebContentsImpl::DidFinishNavigation(NavigationHandle* navigation_handle) { | 3262 void WebContentsImpl::DidFinishNavigation(NavigationHandle* navigation_handle) { |
3263 for (auto& observer : observers_) | 3263 for (auto& observer : observers_) |
3264 observer.DidFinishNavigation(navigation_handle); | 3264 observer.DidFinishNavigation(navigation_handle); |
3265 } | 3265 } |
3266 | 3266 |
3267 void WebContentsImpl::DidStartProvisionalLoad( | 3267 void WebContentsImpl::DidStartProvisionalLoad( |
3268 RenderFrameHostImpl* render_frame_host, | 3268 RenderFrameHostImpl* render_frame_host, |
3269 const GURL& validated_url, | 3269 const GURL& validated_url, |
3270 bool is_error_page, | 3270 bool is_error_page) { |
3271 bool is_iframe_srcdoc) { | |
3272 // Notify observers about the start of the provisional load. | 3271 // Notify observers about the start of the provisional load. |
3273 for (auto& observer : observers_) { | 3272 for (auto& observer : observers_) { |
3274 observer.DidStartProvisionalLoadForFrame(render_frame_host, validated_url, | 3273 observer.DidStartProvisionalLoadForFrame(render_frame_host, validated_url, |
3275 is_error_page, is_iframe_srcdoc); | 3274 is_error_page); |
3276 } | 3275 } |
3277 | 3276 |
3278 // Notify accessibility if this is a reload. | 3277 // Notify accessibility if this is a reload. |
3279 NavigationEntry* entry = controller_.GetVisibleEntry(); | 3278 NavigationEntry* entry = controller_.GetVisibleEntry(); |
3280 if (entry && ui::PageTransitionCoreTypeIs( | 3279 if (entry && ui::PageTransitionCoreTypeIs(entry->GetTransitionType(), |
3281 entry->GetTransitionType(), ui::PAGE_TRANSITION_RELOAD)) { | 3280 ui::PAGE_TRANSITION_RELOAD)) { |
3282 FrameTreeNode* ftn = render_frame_host->frame_tree_node(); | 3281 FrameTreeNode* ftn = render_frame_host->frame_tree_node(); |
3283 BrowserAccessibilityManager* manager = | 3282 BrowserAccessibilityManager* manager = |
3284 ftn->current_frame_host()->browser_accessibility_manager(); | 3283 ftn->current_frame_host()->browser_accessibility_manager(); |
3285 if (manager) | 3284 if (manager) |
3286 manager->UserIsReloading(); | 3285 manager->UserIsReloading(); |
3287 } | 3286 } |
3288 } | 3287 } |
3289 | 3288 |
3290 void WebContentsImpl::DidFailProvisionalLoadWithError( | 3289 void WebContentsImpl::DidFailProvisionalLoadWithError( |
3291 RenderFrameHostImpl* render_frame_host, | 3290 RenderFrameHostImpl* render_frame_host, |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3542 observer.DocumentLoadedInFrame(rfh); | 3541 observer.DocumentLoadedInFrame(rfh); |
3543 } | 3542 } |
3544 | 3543 |
3545 void WebContentsImpl::OnDidFinishLoad(const GURL& url) { | 3544 void WebContentsImpl::OnDidFinishLoad(const GURL& url) { |
3546 if (!HasValidFrameSource()) | 3545 if (!HasValidFrameSource()) |
3547 return; | 3546 return; |
3548 | 3547 |
3549 GURL validated_url(url); | 3548 GURL validated_url(url); |
3550 RenderProcessHost* render_process_host = | 3549 RenderProcessHost* render_process_host = |
3551 render_frame_message_source_->GetProcess(); | 3550 render_frame_message_source_->GetProcess(); |
3552 render_process_host->FilterURL(false, &validated_url); | 3551 if (validated_url != GURL(content::kAboutSrcDocURL)) |
| 3552 render_process_host->FilterURL(false, &validated_url); |
3553 | 3553 |
3554 RenderFrameHostImpl* rfh = | 3554 RenderFrameHostImpl* rfh = |
3555 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); | 3555 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); |
3556 for (auto& observer : observers_) | 3556 for (auto& observer : observers_) |
3557 observer.DidFinishLoad(rfh, validated_url); | 3557 observer.DidFinishLoad(rfh, validated_url); |
3558 } | 3558 } |
3559 | 3559 |
3560 void WebContentsImpl::OnGoToEntryAtOffset(int offset) { | 3560 void WebContentsImpl::OnGoToEntryAtOffset(int offset) { |
3561 if (!delegate_ || delegate_->OnGoToEntryOffset(offset)) | 3561 if (!delegate_ || delegate_->OnGoToEntryOffset(offset)) |
3562 controller_.GoToOffset(offset); | 3562 controller_.GoToOffset(offset); |
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5214 dialog_manager_ = dialog_manager; | 5214 dialog_manager_ = dialog_manager; |
5215 } | 5215 } |
5216 | 5216 |
5217 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5217 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
5218 auto it = binding_sets_.find(interface_name); | 5218 auto it = binding_sets_.find(interface_name); |
5219 if (it != binding_sets_.end()) | 5219 if (it != binding_sets_.end()) |
5220 binding_sets_.erase(it); | 5220 binding_sets_.erase(it); |
5221 } | 5221 } |
5222 | 5222 |
5223 } // namespace content | 5223 } // namespace content |
OLD | NEW |