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

Unified Diff: chrome/browser/browser.cc

Issue 3161037: Remove attempt to be smart about where to open navigations (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: wherps Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/browser_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 63f03384d302dc8fb6ee66ca87265e914dd5ce04..c29ee3f1ba708443a11f6d461f6d7af0e09a540e 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1280,17 +1280,6 @@ void Browser::OpenCurrentURL() {
CloseTabContents(selected_contents);
return;
}
-
- if (selected_contents) {
- // For the purposes of changing the window open disposition, the referrer
- // is the current tab's URL.
- open_disposition = AdjustWindowOpenDispositionForTab(
- IsPinned(selected_contents),
- url,
- selected_contents->GetURL(),
- location_bar->GetPageTransition(),
- open_disposition);
- }
}
// Use ADD_INHERIT_OPENER so that all pages opened by the omnibox at least
@@ -3779,39 +3768,6 @@ Browser* Browser::GetOrCreateTabbedBrowser(Profile* profile) {
return browser;
}
-// static
-WindowOpenDisposition Browser::AdjustWindowOpenDispositionForTab(
- bool is_pinned,
- const GURL& url,
- const GURL& referrer,
- PageTransition::Type transition,
- WindowOpenDisposition original_disposition) {
- if (!is_pinned ||
- original_disposition != CURRENT_TAB ||
- (transition != PageTransition::AUTO_BOOKMARK &&
- transition != PageTransition::LINK &&
- transition != PageTransition::TYPED)) {
- return original_disposition;
- }
-
- bool url_is_http_or_https =
- url.SchemeIs(chrome::kHttpScheme) ||
- url.SchemeIs(chrome::kHttpsScheme);
- bool referrer_is_http_or_https =
- referrer.SchemeIs(chrome::kHttpScheme) ||
- referrer.SchemeIs(chrome::kHttpsScheme);
- bool scheme_matches =
- (url.scheme() == referrer.scheme()) ||
- (url_is_http_or_https && referrer_is_http_or_https);
-
- // If the host and scheme are the same, then we allow the link to open in
- // the current tab, to make the page feel more web-appy.
- if (url.host() == referrer.host() && scheme_matches)
- return original_disposition;
-
- return NEW_FOREGROUND_TAB;
-}
-
void Browser::OpenURLAtIndex(TabContents* source,
const GURL& url,
const GURL& referrer,
@@ -3839,13 +3795,6 @@ void Browser::OpenURLAtIndex(TabContents* source,
delegate->OnUserGesture();
}
- disposition = AdjustWindowOpenDispositionForTab(
- current_tab && IsPinned(current_tab),
- url,
- referrer,
- transition,
- disposition);
-
// If the URL is part of the same web site, then load it in the same
// SiteInstance (and thus the same process). This is an optimization to
// reduce process overhead; it is not necessary for compatibility. (That is,
@@ -4089,12 +4038,3 @@ void Browser::TabRestoreServiceDestroyed(TabRestoreService* service) {
tab_restore_service_->RemoveObserver(this);
tab_restore_service_ = NULL;
}
-
-bool Browser::IsPinned(TabContents* source) {
- int index = tabstrip_model_.GetIndexOfTabContents(source);
- if (index == TabStripModel::kNoTab) {
- NOTREACHED() << "IsPinned called for tab not in our strip";
- return false;
- }
- return tabstrip_model_.IsTabPinned(index);
-}
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/browser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698