diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-26 19:31:36 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-26 19:31:36 +0000 |
commit | 341a1971b19550538de2c67b17fbdfd51ad1dd7f (patch) | |
tree | 0b6a49a28e97ed3735e1a0781114c7df8dd6abd2 /chrome/browser/sessions | |
parent | 996dbb74b6693201d7cf7c7c2a009b627c2a0460 (diff) | |
download | chromium_src-341a1971b19550538de2c67b17fbdfd51ad1dd7f.zip chromium_src-341a1971b19550538de2c67b17fbdfd51ad1dd7f.tar.gz chromium_src-341a1971b19550538de2c67b17fbdfd51ad1dd7f.tar.bz2 |
When restoring a tab with an unknown disposition (i.e., not from the NTP), only use the original browser if it is found on the current desktop.
BUG=170753
(no final UX decision was made other than doing the easiest thing that makes sense for now; this implements the easy solution described in comment #9 on the bug).
Review URL: https://chromiumcodereview.appspot.com/12310138
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r-- | chrome/browser/sessions/tab_restore_service_delegate.h | 5 | ||||
-rw-r--r-- | chrome/browser/sessions/tab_restore_service_helper.cc | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/sessions/tab_restore_service_delegate.h b/chrome/browser/sessions/tab_restore_service_delegate.h index 96d9ec56..f00c8c0 100644 --- a/chrome/browser/sessions/tab_restore_service_delegate.h +++ b/chrome/browser/sessions/tab_restore_service_delegate.h @@ -75,8 +75,11 @@ class TabRestoreServiceDelegate { const content::WebContents* contents); // see chrome::FindBrowserWithID + // Returns the TabRestoreServiceDelegate of the Browser with |desired_id| if + // such a Browser exists and is on the desktop defined by |host_desktop_type|. static TabRestoreServiceDelegate* FindDelegateWithID( - SessionID::id_type desired_id); + SessionID::id_type desired_id, + chrome::HostDesktopType host_desktop_type); protected: virtual ~TabRestoreServiceDelegate() {} diff --git a/chrome/browser/sessions/tab_restore_service_helper.cc b/chrome/browser/sessions/tab_restore_service_helper.cc index 78e7857..7eb99741 100644 --- a/chrome/browser/sessions/tab_restore_service_helper.cc +++ b/chrome/browser/sessions/tab_restore_service_helper.cc @@ -435,8 +435,10 @@ TabRestoreServiceDelegate* TabRestoreServiceHelper::RestoreTab( tab.user_agent_override); } else { // We only respsect the tab's original browser if there's no disposition. - if (disposition == UNKNOWN && tab.has_browser()) - delegate = TabRestoreServiceDelegate::FindDelegateWithID(tab.browser_id); + if (disposition == UNKNOWN && tab.has_browser()) { + delegate = TabRestoreServiceDelegate::FindDelegateWithID( + tab.browser_id, host_desktop_type); + } int tab_index = -1; |