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

Unified Diff: chrome/browser/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 tab mru list manager class. Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/tabs/tab_mru_list_manager.h
diff --git a/chrome/browser/tabs/tab_mru_list_manager.h b/chrome/browser/tabs/tab_mru_list_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..45bbc7b61b62fd2a6d8eb4f3cc1cb95203405085
--- /dev/null
+++ b/chrome/browser/tabs/tab_mru_list_manager.h
@@ -0,0 +1,37 @@
+// 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_TABS_TAB_MRU_LIST_MANAGER_H_
sky 2012/05/25 17:56:52 This should be in chrome/browser/ui/tabs.
NaveenBobbili (Motorola) 2012/05/29 11:41:05 Done.
NaveenBobbili (Motorola) 2012/05/29 11:41:05 Done.
+#define CHROME_BROWSER_TABS_TAB_MRU_LIST_MANAGER_H_
+#pragma once
+
+#include <list>
+
+class TabContentsWrapper;
+////////////////////////////////////////////////////////////////////////////////
+//
+// TabMRUListManager
+//
+// This is a list that manages the tabs that are in a tab strip as per the most
+// recently used priority order.
+//
+////////////////////////////////////////////////////////////////////////////////
+class TabMRUListManager {
sky 2012/05/25 17:56:52 TabMRUListManager should be a TabStripModelObserve
NaveenBobbili (Motorola) 2012/05/29 11:41:05 Done.
+ public:
+ virtual ~TabMRUListManager();
sky 2012/05/25 17:56:52 no virtual
+
+ void ActivateContents(TabContentsWrapper* new_contents);
+ void AppendContents(TabContentsWrapper* new_contents);
+ void ClearContents();
+ TabContentsWrapper* GetNextMRUTab();
+ void RemoveContents(TabContentsWrapper* removed_contents);
+ void ReplaceContents(
+ TabContentsWrapper* old_contents, TabContentsWrapper* new_contents);
+
+ private:
+ // List that maintains the tab indices in the most recently visited order
+ typedef std::list<TabContentsWrapper*> TabsMRUList;
+ TabsMRUList tabs_mru_list_;
+};
sky 2012/05/25 17:56:52 DISALLOW_COPY_AND_ASSIGN
+#endif // CHROME_BROWSER_TABS_TAB_MRU_LIST_MANAGER_H_
sky 2012/05/25 17:56:52 newline between 36/67.

Powered by Google App Engine
This is Rietveld 408576698