OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
9 #include "content/browser/frame_host/frame_tree_node.h" | 9 #include "content/browser/frame_host/frame_tree_node.h" |
10 #include "content/browser/frame_host/navigation_controller_impl.h" | 10 #include "content/browser/frame_host/navigation_controller_impl.h" |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 delegate_->DidNavigateMainFramePostCommit(details, params); | 519 delegate_->DidNavigateMainFramePostCommit(details, params); |
520 | 520 |
521 delegate_->DidNavigateAnyFramePostCommit( | 521 delegate_->DidNavigateAnyFramePostCommit( |
522 render_frame_host, details, params); | 522 render_frame_host, details, params); |
523 } | 523 } |
524 } | 524 } |
525 | 525 |
526 bool NavigatorImpl::ShouldAssignSiteForURL(const GURL& url) { | 526 bool NavigatorImpl::ShouldAssignSiteForURL(const GURL& url) { |
527 // about:blank should not "use up" a new SiteInstance. The SiteInstance can | 527 // about:blank should not "use up" a new SiteInstance. The SiteInstance can |
528 // still be used for a normal web site. | 528 // still be used for a normal web site. |
529 if (url == GURL(kAboutBlankURL)) | 529 if (url == GURL(url::kAboutBlankURL)) |
530 return false; | 530 return false; |
531 | 531 |
532 // The embedder will then have the opportunity to determine if the URL | 532 // The embedder will then have the opportunity to determine if the URL |
533 // should "use up" the SiteInstance. | 533 // should "use up" the SiteInstance. |
534 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); | 534 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); |
535 } | 535 } |
536 | 536 |
537 void NavigatorImpl::RequestOpenURL( | 537 void NavigatorImpl::RequestOpenURL( |
538 RenderFrameHostImpl* render_frame_host, | 538 RenderFrameHostImpl* render_frame_host, |
539 const GURL& url, | 539 const GURL& url, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 WindowOpenDisposition disposition, | 572 WindowOpenDisposition disposition, |
573 const GlobalRequestID& transferred_global_request_id, | 573 const GlobalRequestID& transferred_global_request_id, |
574 bool should_replace_current_entry, | 574 bool should_replace_current_entry, |
575 bool user_gesture) { | 575 bool user_gesture) { |
576 GURL dest_url(url); | 576 GURL dest_url(url); |
577 SiteInstance* current_site_instance = | 577 SiteInstance* current_site_instance = |
578 GetRenderManager(render_frame_host)->current_frame_host()-> | 578 GetRenderManager(render_frame_host)->current_frame_host()-> |
579 GetSiteInstance(); | 579 GetSiteInstance(); |
580 if (!GetContentClient()->browser()->ShouldAllowOpenURL( | 580 if (!GetContentClient()->browser()->ShouldAllowOpenURL( |
581 current_site_instance, url)) { | 581 current_site_instance, url)) { |
582 dest_url = GURL(kAboutBlankURL); | 582 dest_url = GURL(url::kAboutBlankURL); |
583 } | 583 } |
584 | 584 |
585 int64 frame_tree_node_id = -1; | 585 int64 frame_tree_node_id = -1; |
586 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) { | 586 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) { |
587 frame_tree_node_id = | 587 frame_tree_node_id = |
588 render_frame_host->frame_tree_node()->frame_tree_node_id(); | 588 render_frame_host->frame_tree_node()->frame_tree_node_id(); |
589 } | 589 } |
590 OpenURLParams params( | 590 OpenURLParams params( |
591 dest_url, referrer, frame_tree_node_id, disposition, page_transition, | 591 dest_url, referrer, frame_tree_node_id, disposition, page_transition, |
592 true /* is_renderer_initiated */); | 592 true /* is_renderer_initiated */); |
(...skipping 21 matching lines...) Expand all Loading... |
614 | 614 |
615 // Navigations in Web UI pages count as browser-initiated navigations. | 615 // Navigations in Web UI pages count as browser-initiated navigations. |
616 params.is_renderer_initiated = false; | 616 params.is_renderer_initiated = false; |
617 } | 617 } |
618 | 618 |
619 if (delegate_) | 619 if (delegate_) |
620 delegate_->RequestOpenURL(render_frame_host, params); | 620 delegate_->RequestOpenURL(render_frame_host, params); |
621 } | 621 } |
622 | 622 |
623 } // namespace content | 623 } // namespace content |
OLD | NEW |