| Index: chrome/browser/ui/tabs/mru_tab_controller.h
|
| diff --git a/chrome/browser/ui/tabs/mru_tab_controller.h b/chrome/browser/ui/tabs/mru_tab_controller.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..17a9c48e511cbedb10fd4199988d9c4b29eac376
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/tabs/mru_tab_controller.h
|
| @@ -0,0 +1,66 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_UI_TABS_MRU_TAB_CONTROLLER_H_
|
| +#define CHROME_BROWSER_UI_TABS_MRU_TAB_CONTROLLER_H_
|
| +
|
| +#include <list>
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/compiler_specific.h"
|
| +#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
|
| +
|
| +class TabContents;
|
| +class TabStripModel;
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| +//
|
| +// MRUTabController
|
| +//
|
| +// This is a list that manages the tabs that are in a tab strip as per the most
|
| +// recently used priority order. This overrides TabStrip Model Observer.
|
| +//
|
| +////////////////////////////////////////////////////////////////////////////////
|
| +class MRUTabController : public TabStripModelObserver {
|
| + public:
|
| + explicit MRUTabController(TabStripModel* tab_strip_model);
|
| + virtual ~MRUTabController();
|
| +
|
| + // Retrieves the previously used tab in the mru list
|
| + TabContents* GetPreviousMRUTab();
|
| +
|
| + // Pauses changes to the mru list.
|
| + void PauseStackUpdates();
|
| +
|
| + // Updates the mru list by bringing currently active
|
| + // tab to the front of the list.
|
| + void CommitActiveTabChanges();
|
| +
|
| + // Overridden from TabStripModelObserver:
|
| + virtual void TabInsertedAt(TabContents* contents,
|
| + int index,
|
| + bool foreground) OVERRIDE;
|
| + virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;
|
| + virtual void ActiveTabChanged(TabContents* old_contents,
|
| + TabContents* new_contents,
|
| + int index,
|
| + bool user_gesture) OVERRIDE;
|
| + virtual void TabReplacedAt(TabStripModel* tab_strip_model,
|
| + TabContents* old_contents,
|
| + TabContents* new_contents,
|
| + int index) OVERRIDE;
|
| + virtual void TabStripEmpty() OVERRIDE;
|
| +
|
| + private:
|
| + // List that maintains the tab indices in the most recently visited order
|
| + typedef std::list<TabContents*> TabsMRUList;
|
| + TabsMRUList tabs_mru_list_;
|
| +
|
| + TabStripModel* tab_strip_model_;
|
| +
|
| + bool can_update_stack_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(MRUTabController);
|
| +};
|
| +#endif // CHROME_BROWSER_UI_TABS_MRU_TAB_CONTROLLER_H_
|
|
|