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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.h

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 (moved pref logic to browser_view_prefs) 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/views/tabs/tab_strip.h
diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h
index 82c9c48bd040fd5c4ffc536ae29fc694a282f2b9..cc23ba230b21dde0565ad7159e2a1b645c2c7609 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.h
+++ b/chrome/browser/ui/views/tabs/tab_strip.h
@@ -10,7 +10,6 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/timer/timer.h"
-#include "chrome/browser/ui/tabs/tab_strip_layout_type.h"
#include "chrome/browser/ui/views/tabs/tab.h"
#include "chrome/browser/ui/views/tabs/tab_controller.h"
#include "ui/gfx/animation/animation_container.h"
@@ -64,11 +63,20 @@ class TabStrip : public views::View,
void AddObserver(TabStripObserver* observer);
void RemoveObserver(TabStripObserver* observer);
- // Sets the layout type. If |adjust_layout| is true the layout type changes
+ // If |adjust_layout| is true the layout type changes
sky 2014/05/28 19:45:56 layout type-> stacked layout. In fact you'll likel
varkha 2014/05/28 22:15:56 Done.
// based on whether the user uses a mouse or touch device with the tabstrip.
- // If |adjust_layout| is false the layout is fixed to |layout_type|.
- void SetLayoutType(TabStripLayoutType layout_type, bool adjust_layout);
- TabStripLayoutType layout_type() const { return layout_type_; }
+ void set_adjust_layout(bool adjust_layout) { adjust_layout_ = adjust_layout; }
+
+ // |stacked_layout_| defines what should happen when the tabs won't fit at
+ // their ideal size. When |stacked_layout_| is true 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.
+ // When |stacked_layout_| is false the tabs shrink to accommodate the
+ // available space. This is the default.
+ bool stacked_layout() const { return stacked_layout_; }
+
+ // Sets if the layout type is stacked and animates if necessary.
+ void SetStackedLayout(bool stacked_layout);
// Returns the bounds of the new tab button.
gfx::Rect GetNewTabButtonBounds();
@@ -543,9 +551,6 @@ class TabStrip : public views::View,
// is reset.
void SetResetToShrinkOnExit(bool value);
- // Should the layout dynamically adjust?
- bool GetAdjustLayout() const;
-
// -- Member Variables ------------------------------------------------------
// There is a one-to-one mapping between each of the tabs in the
@@ -596,7 +601,7 @@ class TabStrip : public views::View,
// MouseWatcher is used for two things:
// . When a tab is closed to reset the layout.
// . When a mouse is used and the layout dynamically adjusts and is currently
- // TAB_STRIP_LAYOUT_STACKED.
+ // stacked (|stacked_layout_| is true).
scoped_ptr<views::MouseWatcher> mouse_watcher_;
// The controller for a drag initiated from a Tab. Valid for the lifetime of
@@ -608,16 +613,17 @@ class TabStrip : public views::View,
// Size we last layed out at.
gfx::Size last_layout_size_;
- TabStripLayoutType layout_type_;
+ // See description above stacked_layout().
+ bool stacked_layout_;
- // See description above SetLayoutType().
+ // Should the layout dynamically adjust?
bool adjust_layout_;
// Only used while in touch mode.
scoped_ptr<StackedTabStripLayout> touch_layout_;
- // If true the layout type is set to TAB_STRIP_LAYOUT_SHRINK when the mouse
- // exits the tabstrip (as determined using MouseWatcher).
+ // If true the layout type is set to not stacked when the mouse exits the
+ // tabstrip (as determined using MouseWatcher).
bool reset_to_shrink_on_exit_;
// Location of the mouse at the time of the last move.

Powered by Google App Engine
This is Rietveld 408576698