diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-10 22:25:09 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-10 22:25:09 +0000 |
commit | 3eac70b953bd3bf9b1aeccc84b6a92bcbf85d0eb (patch) | |
tree | 70a83e3f34e6c6c39701b21b45a4370dcfec17e0 /chrome/browser/tabs/tab_strip_model.h | |
parent | 6ecc60e234224d61cb6a5157ebbc65448e66b716 (diff) | |
download | chromium_src-3eac70b953bd3bf9b1aeccc84b6a92bcbf85d0eb.zip chromium_src-3eac70b953bd3bf9b1aeccc84b6a92bcbf85d0eb.tar.gz chromium_src-3eac70b953bd3bf9b1aeccc84b6a92bcbf85d0eb.tar.bz2 |
Move opener/group relationship forgetting on navigation into TabStripModel from browser, and write unit tests for it.
Review URL: http://codereview.chromium.org/20233
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9518 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs/tab_strip_model.h')
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h index 9183b1b..b12ff80 100644 --- a/chrome/browser/tabs/tab_strip_model.h +++ b/chrome/browser/tabs/tab_strip_model.h @@ -185,13 +185,6 @@ class TabStripModel : public NotificationObserver { // Retrieve the Profile associated with this TabStripModel. Profile* profile() const { return profile_; } - // Retrieve/set the active TabStripModelOrderController associated with this - // TabStripModel - TabStripModelOrderController* order_controller() const { - return order_controller_; - } - void SetOrderController(TabStripModelOrderController* order_controller); - // Retrieve the index of the currently selected TabContents. int selected_index() const { return selected_index_; } @@ -204,6 +197,11 @@ class TabStripModel : public NotificationObserver { // avoid doing meaningless or unhelpful work. bool closing_all() const { return closing_all_; } + // Access the order controller. Exposed only for unit tests. + TabStripModelOrderController* order_controller() const { + return order_controller_; + } + // Basic API ///////////////////////////////////////////////////////////////// static const int kNoTab = -1; @@ -312,6 +310,12 @@ class TabStripModel : public NotificationObserver { int GetIndexOfLastTabContentsOpenedBy(NavigationController* opener, int start_index); + // Called by the Browser when a navigation is about to occur in the specified + // TabContents. Depending on the tab, and the transition type of the + // navigation, the TabStripModel may adjust its selection and grouping + // behavior. + void TabNavigating(TabContents* contents, PageTransition::Type transition); + // Forget all Opener relationships that are stored (but _not_ group // relationships!) This is to reduce unpredictable tab switching behavior // in complex session states. The exact circumstances under which this method @@ -398,6 +402,13 @@ class TabStripModel : public NotificationObserver { // We cannot be constructed without a delegate. TabStripModel(); + // Returns true if the specified TabContents is a New Tab at the end of the + // TabStrip. We check for this because opener relationships are _not_ + // forgotten for the New Tab page opened as a result of a New Tab gesture + // (e.g. Ctrl+T, etc) since the user may open a tab transiently to look up + // something related to their current activity. + bool IsNewTabAtEndOfTabStrip(TabContents* contents) const; + // Closes the TabContents at the specified index. This causes the TabContents // to be destroyed, but it may not happen immediately (e.g. if it's a // WebContents). If the page in question has an unload event the TabContents |