Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: chrome/browser/ui/tabs/tab_mru_list_manager.h

Issue 10117016: Implementation for switching between recently used tabs using ctrl tilde or quoteleft. Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added unit test Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_TABS_TAB_MRU_LIST_MANAGER_H_
6 #define CHROME_BROWSER_UI_TABS_TAB_MRU_LIST_MANAGER_H_
7 #pragma once
8
9 #include <list>
10
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "chrome/browser/ui/tabs/tab_strip_model.h"
14 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
15
16 class TabContentsWrapper;
17 ////////////////////////////////////////////////////////////////////////////////
18 //
19 // TabMRUListManager
20 //
21 // This is a list that manages the tabs that are in a tab strip as per the most
22 // recently used priority order. This overrides TabStrip Model Observer.
23 //
24 ////////////////////////////////////////////////////////////////////////////////
25 class TabMRUListManager : public TabStripModelObserver {
26 public:
27 TabMRUListManager(TabStripModel* tab_strip_model);
sky 2012/06/11 18:21:51 explicit
NaveenBobbili (Motorola) 2012/06/13 06:07:32 Done.
28 virtual ~TabMRUListManager();
29
30 TabContentsWrapper* GetNextMRUTab();
31
32 // Overridden from TabStripModelObserver:
33 virtual void TabInsertedAt(TabContentsWrapper* contents,
34 int index,
35 bool foreground) OVERRIDE;
36 virtual void TabDetachedAt(TabContentsWrapper* contents, int index) OVERRIDE;
37 virtual void ActiveTabChanged(TabContentsWrapper* old_contents,
38 TabContentsWrapper* new_contents,
39 int index,
40 bool user_gesture) OVERRIDE;
41 virtual void TabReplacedAt(TabStripModel* tab_strip_model,
42 TabContentsWrapper* old_contents,
43 TabContentsWrapper* new_contents,
44 int index) OVERRIDE;
45 virtual void TabStripEmpty() OVERRIDE;
46
47 private:
48 // List that maintains the tab indices in the most recently visited order
49 typedef std::list<TabContentsWrapper*> TabsMRUList;
50 TabsMRUList tabs_mru_list_;
51
52 TabStripModel* tab_strip_model_;
53
54 DISALLOW_COPY_AND_ASSIGN(TabMRUListManager);
55 };
56
57 #endif // CHROME_BROWSER_UI_TABS_TAB_MRU_LIST_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698