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

Side by Side Diff: chrome/browser/ui/browser_navigator.cc

Issue 15041004: Replace PruneAllButActive with PruneAllButVisible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 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 (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 "chrome/browser/ui/browser_navigator.h" 5 #include "chrome/browser/ui/browser_navigator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 GURL url; 533 GURL url;
534 if (params->url.is_empty()) { 534 if (params->url.is_empty()) {
535 url = params->browser->profile()->GetHomePage(); 535 url = params->browser->profile()->GetHomePage();
536 params->transition = content::PageTransitionFromInt( 536 params->transition = content::PageTransitionFromInt(
537 params->transition | content::PAGE_TRANSITION_HOME_PAGE); 537 params->transition | content::PAGE_TRANSITION_HOME_PAGE);
538 } else { 538 } else {
539 url = params->url; 539 url = params->url;
540 } 540 }
541 541
542 if (params->disposition != CURRENT_TAB) { 542 if (params->disposition != CURRENT_TAB) {
543 // TODO(creis): We can't allow this to swap in a pending navigation to the
544 // local NTP until it commits. Not sure how to achieve that.
543 swapped_in_instant = SwapInInstantNTP(params, url, NULL); 545 swapped_in_instant = SwapInInstantNTP(params, url, NULL);
544 if (!swapped_in_instant) 546 if (!swapped_in_instant)
545 params->target_contents = CreateTargetContents(*params, url); 547 params->target_contents = CreateTargetContents(*params, url);
546 548
547 // This function takes ownership of |params->target_contents| until it 549 // This function takes ownership of |params->target_contents| until it
548 // is added to a TabStripModel. 550 // is added to a TabStripModel.
549 target_contents_owner.TakeOwnership(); 551 target_contents_owner.TakeOwnership();
550 } else { 552 } else {
551 // ... otherwise if we're loading in the current tab, the target is the 553 // ... otherwise if we're loading in the current tab, the target is the
552 // same as the source. 554 // same as the source.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 bool reverse_on_redirect = false; 670 bool reverse_on_redirect = false;
669 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 671 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
670 &rewritten_url, browser_context, &reverse_on_redirect); 672 &rewritten_url, browser_context, &reverse_on_redirect);
671 673
672 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 674 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
673 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && 675 return !(rewritten_url.scheme() == chrome::kChromeUIScheme &&
674 rewritten_url.host() == chrome::kChromeUIUberHost); 676 rewritten_url.host() == chrome::kChromeUIUberHost);
675 } 677 }
676 678
677 } // namespace chrome 679 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698