diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-17 20:50:29 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-17 20:50:29 +0000 |
commit | 3698f173be9c6bf67816ad7e1ec194dd83438cba (patch) | |
tree | dd95954931d37a7183881dda2778d0f14d9d7e7e /chrome/browser/browser.h | |
parent | 4462559524df6726acc2400113508f3dc22b3648 (diff) | |
download | chromium_src-3698f173be9c6bf67816ad7e1ec194dd83438cba.zip chromium_src-3698f173be9c6bf67816ad7e1ec194dd83438cba.tar.gz chromium_src-3698f173be9c6bf67816ad7e1ec194dd83438cba.tar.bz2 |
[Mac] Honor modifier keys in back/forward menu.
Add a method ActivatedAtWithDisposition to BackForwardMenuModel that navigates to a history item with a certain window disposition (current tab, new background/foreground tab).
Change BackForwardMenuController to call ActivatedAtWithDisposition with the disposition created from the current NSEvent.
Also, factor out some common code in Browser::GoBack and GoForward.
BUG=37984
TEST=Navigate to a history item in the back/forward menu while holding down the command key. The item should open in a new tab. Likewise, holding down cmd-shift should open it in a new foreground tab.
Review URL: http://codereview.chromium.org/910001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.h')
-rw-r--r-- | chrome/browser/browser.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index 0082504..37e62505 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -349,6 +349,10 @@ class Browser : public TabStripModelDelegate, // Returns true if a tab can be restored. virtual bool CanRestoreTab(); + // Navigate to an index in the tab history, opening a new tab depending on the + // disposition. + bool NavigateToIndexWithDisposition(int index, WindowOpenDisposition disp); + // Show a given a URL. If a tab with the same URL (ignoring the ref) is // already visible in this browser, it becomes selected. Otherwise a new tab // is created. @@ -797,6 +801,11 @@ class Browser : public TabStripModelDelegate, // Shared code between Reload() and ReloadAll(). void ReloadInternal(bool ignore_cache); + // Depending on the disposition, return the |NavigationController| for the + // current tab or clone the current tab and return its |NavigationController|. + NavigationController& GetOrCloneNavigationControllerForDisposition( + WindowOpenDisposition disp); + // Data members ///////////////////////////////////////////////////////////// NotificationRegistrar registrar_; |