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

Unified Diff: chrome/browser/ui/tabs/tab_strip_layout_type_prefs.cc

Issue 291093005: Removes --enable-stacked-tab-strip flag (Stacked Tabs) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removes --enable-stacked-tab-strip flag (more refactoring) Created 6 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/ui/tabs/tab_strip_layout_type_prefs.cc
diff --git a/chrome/browser/ui/tabs/tab_strip_layout_type_prefs.cc b/chrome/browser/ui/tabs/tab_strip_layout_type_prefs.cc
index 44207908e54270738328f69fe14f7082c9817717..2dff23bdc19b1f8a01042d91870334246239abf0 100644
--- a/chrome/browser/ui/tabs/tab_strip_layout_type_prefs.cc
+++ b/chrome/browser/ui/tabs/tab_strip_layout_type_prefs.cc
@@ -5,15 +5,30 @@
#include "chrome/browser/ui/tabs/tab_strip_layout_type_prefs.h"
#include "base/prefs/pref_registry_simple.h"
-#include "chrome/browser/ui/tabs/tab_strip_layout_type.h"
+#include "base/prefs/pref_service.h"
#include "chrome/common/pref_names.h"
namespace chrome {
-void RegisterTabStripLayoutTypePrefs(PrefRegistrySimple* registry) {
- // This value is device dependant, so it goes in local state.
- registry->RegisterIntegerPref(prefs::kTabStripLayoutType,
- static_cast<int>(TAB_STRIP_LAYOUT_SHRINK));
+// The following values are persisted in prefs:
+// 0 - Tabs shrink to accommodate the available space. This is the default.
+// 1 - The tabs are always sized to their ideal size and stacked on top of each
+// other so that only a certain set of tabs are visible. This is used when
+// the user uses a touch device.
Peter Kasting 2014/05/23 17:48:46 Don't use an integer pref for this, use a boolean
varkha 2014/05/23 17:51:57 That would be great but don't we want to preserve
varkha 2014/05/23 21:45:48 Done. The file is still there (unmodified) since i
+
+void TabStripLayoutTypePrefs::Register(PrefRegistrySimple* registry) {
+ // This value is device dependent, so it goes in local state.
+ // 0 is the default (not stacked) layout type in prefs.
+ registry->RegisterIntegerPref(prefs::kTabStripLayoutType, 0);
+}
+
+bool TabStripLayoutTypePrefs::GetStackedLayout(PrefService* prefs) {
+ return prefs->GetInteger(prefs::kTabStripLayoutType) != 0;
+}
+
+void TabStripLayoutTypePrefs::SetStackedLayout(PrefService* prefs,
+ bool stacked_layout) {
+ prefs->SetInteger(prefs::kTabStripLayoutType, stacked_layout ? 0 : 1);
Peter Kasting 2014/05/23 17:48:46 Isn't this backwards? Using a bool pref with a go
varkha 2014/05/23 21:45:48 Exactly! That's why getting rid of this in favour
}
} // namespace chrome
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_layout_type_prefs.h ('k') | chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698