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

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: Fixed review comments. 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"
sky 2012/06/15 19:47:39 You shouldn't need this include.
NaveenBobbili (Motorola) 2012/06/25 09:44:23 Done.
14 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
15
16 class TabContentsWrapper;
17 ////////////////////////////////////////////////////////////////////////////////
sky 2012/06/15 19:47:39 newline between 16 and 17.
NaveenBobbili (Motorola) 2012/06/25 09:44:23 Done.
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 {
sky 2012/06/15 19:47:39 Name this MRUTabController.
NaveenBobbili (Motorola) 2012/06/25 09:44:23 Done.
26 public:
27 explicit TabMRUListManager(TabStripModel* tab_strip_model);
28 virtual ~TabMRUListManager();
29
30 // Overridden from TabStripModelObserver:
sky 2012/06/15 19:47:39 overriden methods should be grouped at the end of
NaveenBobbili (Motorola) 2012/06/25 09:44:23 Done.
31 virtual void TabInsertedAt(TabContentsWrapper* contents,
32 int index,
33 bool foreground) OVERRIDE;
34 virtual void TabDetachedAt(TabContentsWrapper* contents, int index) OVERRIDE;
35 virtual void ActiveTabChanged(TabContentsWrapper* old_contents,
36 TabContentsWrapper* new_contents,
37 int index,
38 bool user_gesture) OVERRIDE;
39 virtual void TabReplacedAt(TabStripModel* tab_strip_model,
40 TabContentsWrapper* old_contents,
41 TabContentsWrapper* new_contents,
42 int index) OVERRIDE;
43 virtual void TabStripEmpty() OVERRIDE;
44
45 TabContentsWrapper* GetPreviousMRUTab();
sky 2012/06/15 19:47:39 You need to sync, TCW is now TabContents. Also, ad
NaveenBobbili (Motorola) 2012/06/25 09:44:23 Done.
46
47 void PauseStackUpdates();
48
49 void CommitActiveTabChanges();
50
51 private:
52 // List that maintains the tab indices in the most recently visited order
53 typedef std::list<TabContentsWrapper*> TabsMRUList;
54 TabsMRUList tabs_mru_list_;
55
56 TabStripModel* tab_strip_model_;
57
58 bool can_update_stack_;
59
60 DISALLOW_COPY_AND_ASSIGN(TabMRUListManager);
61 };
62
63 #endif // CHROME_BROWSER_UI_TABS_TAB_MRU_LIST_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698