diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 18:19:30 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 18:19:30 +0000 |
commit | 83bf2d146af122c866abb89e2556211b39250740 (patch) | |
tree | 3662272c7d663e48bef996763dfeb13bb0c5eb03 /chrome/browser/browser.cc | |
parent | 44017e99e77c623f725b4e6b87b40ecc216bd724 (diff) | |
download | chromium_src-83bf2d146af122c866abb89e2556211b39250740.zip chromium_src-83bf2d146af122c866abb89e2556211b39250740.tar.gz chromium_src-83bf2d146af122c866abb89e2556211b39250740.tar.bz2 |
Relaxes constraint that typing in a url in the omnibox of a pinned tab
opens in foreground to allow changes to the path of the url to open in
current tab.
BUG=26490
TEST=none
Review URL: http://codereview.chromium.org/372001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 96c44af..3bdbb97 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -777,13 +777,19 @@ void Browser::OpenCurrentURL() { LocationBar* location_bar = window_->GetLocationBar(); WindowOpenDisposition open_disposition = location_bar->GetWindowOpenDisposition(); + GURL url(WideToUTF8(location_bar->GetInputString())); if (open_disposition == CURRENT_TAB && tabstrip_model()->IsTabPinned(selected_index())) { // To make pinned tabs feel more permanent any requests from the omnibox - // to open a url in the current tab result in creating a new tab. - open_disposition = NEW_FOREGROUND_TAB; - } - OpenURLAtIndex(NULL, GURL(WideToUTF8(location_bar->GetInputString())), GURL(), + // to open a url in the current tab with a host different from the current + // host of the pinned tab result in creating a new tab. We allow changes to + // the path so that the user can trigger reloads or fix up parts of the url + // without spawning a new tab. + TabContents* selected_contents = GetSelectedTabContents(); + if (!selected_contents || url.host() != selected_contents->GetURL().host()) + open_disposition = NEW_FOREGROUND_TAB; + } + OpenURLAtIndex(NULL, url, GURL(), open_disposition, location_bar->GetPageTransition(), -1, true); } |