Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 325443002: Move about://-related constants from //content to //url (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android ifx Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 delegate_->DidNavigateMainFramePostCommit(details, params); 536 delegate_->DidNavigateMainFramePostCommit(details, params);
537 537
538 delegate_->DidNavigateAnyFramePostCommit( 538 delegate_->DidNavigateAnyFramePostCommit(
539 render_frame_host, details, params); 539 render_frame_host, details, params);
540 } 540 }
541 } 541 }
542 542
543 bool NavigatorImpl::ShouldAssignSiteForURL(const GURL& url) { 543 bool NavigatorImpl::ShouldAssignSiteForURL(const GURL& url) {
544 // about:blank should not "use up" a new SiteInstance. The SiteInstance can 544 // about:blank should not "use up" a new SiteInstance. The SiteInstance can
545 // still be used for a normal web site. 545 // still be used for a normal web site.
546 if (url == GURL(kAboutBlankURL)) 546 if (url == GURL(url::kAboutBlankURL))
547 return false; 547 return false;
548 548
549 // The embedder will then have the opportunity to determine if the URL 549 // The embedder will then have the opportunity to determine if the URL
550 // should "use up" the SiteInstance. 550 // should "use up" the SiteInstance.
551 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); 551 return GetContentClient()->browser()->ShouldAssignSiteForURL(url);
552 } 552 }
553 553
554 void NavigatorImpl::RequestOpenURL( 554 void NavigatorImpl::RequestOpenURL(
555 RenderFrameHostImpl* render_frame_host, 555 RenderFrameHostImpl* render_frame_host,
556 const GURL& url, 556 const GURL& url,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 WindowOpenDisposition disposition, 589 WindowOpenDisposition disposition,
590 const GlobalRequestID& transferred_global_request_id, 590 const GlobalRequestID& transferred_global_request_id,
591 bool should_replace_current_entry, 591 bool should_replace_current_entry,
592 bool user_gesture) { 592 bool user_gesture) {
593 GURL dest_url(url); 593 GURL dest_url(url);
594 SiteInstance* current_site_instance = 594 SiteInstance* current_site_instance =
595 GetRenderManager(render_frame_host)->current_frame_host()-> 595 GetRenderManager(render_frame_host)->current_frame_host()->
596 GetSiteInstance(); 596 GetSiteInstance();
597 if (!GetContentClient()->browser()->ShouldAllowOpenURL( 597 if (!GetContentClient()->browser()->ShouldAllowOpenURL(
598 current_site_instance, url)) { 598 current_site_instance, url)) {
599 dest_url = GURL(kAboutBlankURL); 599 dest_url = GURL(url::kAboutBlankURL);
600 } 600 }
601 601
602 int64 frame_tree_node_id = -1; 602 int64 frame_tree_node_id = -1;
603 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) { 603 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) {
604 frame_tree_node_id = 604 frame_tree_node_id =
605 render_frame_host->frame_tree_node()->frame_tree_node_id(); 605 render_frame_host->frame_tree_node()->frame_tree_node_id();
606 } 606 }
607 OpenURLParams params( 607 OpenURLParams params(
608 dest_url, referrer, frame_tree_node_id, disposition, page_transition, 608 dest_url, referrer, frame_tree_node_id, disposition, page_transition,
609 true /* is_renderer_initiated */); 609 true /* is_renderer_initiated */);
(...skipping 21 matching lines...) Expand all
631 631
632 // Navigations in Web UI pages count as browser-initiated navigations. 632 // Navigations in Web UI pages count as browser-initiated navigations.
633 params.is_renderer_initiated = false; 633 params.is_renderer_initiated = false;
634 } 634 }
635 635
636 if (delegate_) 636 if (delegate_)
637 delegate_->RequestOpenURL(render_frame_host, params); 637 delegate_->RequestOpenURL(render_frame_host, params);
638 } 638 }
639 639
640 } // namespace content 640 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698