diff options
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.cc | 12 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.h | 3 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_strip.cc | 12 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_strip.h | 3 |
4 files changed, 14 insertions, 16 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index 7b85532..0993372 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -465,7 +465,7 @@ class ResizeLayoutAnimation : public TabStripGtk::TabAnimation { // Overridden from AnimationDelegate: virtual void AnimationEnded(const Animation* animation) { - tabstrip_->resize_layout_scheduled_ = false; + tabstrip_->needs_resize_layout_ = false; TabStripGtk::TabAnimation::AnimationEnded(animation); } @@ -607,7 +607,7 @@ class PinAndMoveAnimation : public TabStripGtk::TabAnimation { } virtual void AnimationEnded(const Animation* animation) { - tabstrip_->resize_layout_scheduled_ = false; + tabstrip_->needs_resize_layout_ = false; TabStripGtk::TabAnimation::AnimationEnded(animation); } @@ -676,7 +676,7 @@ TabStripGtk::TabStripGtk(TabStripModel* model, BrowserWindowGtk* window) : current_unselected_width_(TabGtk::GetStandardSize().width()), current_selected_width_(TabGtk::GetStandardSize().width()), available_width_for_tabs_(-1), - resize_layout_scheduled_(false), + needs_resize_layout_(false), model_(model), window_(window), theme_provider_(GtkThemeProvider::GetFrom(model->profile())), @@ -984,7 +984,7 @@ void TabStripGtk::TabSelectedAt(TabContents* old_contents, // We have "tiny tabs" if the tabs are so tiny that the unselected ones are // a different size to the selected ones. bool tiny_tabs = current_unselected_width_ != current_selected_width_; - if (!IsAnimating() && (!resize_layout_scheduled_ || tiny_tabs)) + if (!IsAnimating() && (!needs_resize_layout_ || tiny_tabs)) Layout(); GetTabAt(index)->SchedulePaint(); @@ -1071,7 +1071,7 @@ void TabStripGtk::CloseTab(TabGtk* tab) { // Tabs are not resized until a later time (when the mouse pointer leaves // the TabStrip). available_width_for_tabs_ = GetAvailableWidthForTabs(last_tab); - resize_layout_scheduled_ = true; + needs_resize_layout_ = true; // We hook into the message loop in order to receive mouse move events when // the mouse is outside of the tabstrip. We unhook once the resize layout // animation is started. @@ -1296,7 +1296,7 @@ void TabStripGtk::LayoutNewTabButton(double last_tab_right, gfx::Rect bounds(0, kNewTabButtonVOffset, newtab_button_->width(), newtab_button_->height()); int delta = abs(Round(unselected_width) - TabGtk::GetStandardSize().width()); - if (delta > 1 && !resize_layout_scheduled_) { + if (delta > 1 && !needs_resize_layout_) { // We're shrinking tabs, so we need to anchor the New Tab button to the // right edge of the TabStrip's bounds, rather than the right edge of the // right-most Tab, otherwise it'll bounce when animating. diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.h b/chrome/browser/gtk/tabs/tab_strip_gtk.h index c13ceca..425836c 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.h +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.h @@ -413,8 +413,7 @@ class TabStripGtk : public TabStripModelObserver, // True if a resize layout animation should be run a short delay after the // mouse exits the TabStrip. - // TODO(beng): (Cleanup) this would be better named "needs_resize_layout_". - bool resize_layout_scheduled_; + bool needs_resize_layout_; // The GtkFixed widget. OwnedWidgetGtk tabstrip_; diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index 35328af..ef64c48 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -504,7 +504,7 @@ class TabStrip::ResizeLayoutAnimation : public TabStrip::TabAnimation { // Overridden from AnimationDelegate: virtual void AnimationEnded(const Animation* animation) { - tabstrip_->resize_layout_scheduled_ = false; + tabstrip_->needs_resize_layout_ = false; TabStrip::TabAnimation::AnimationEnded(animation); } @@ -645,7 +645,7 @@ class TabStrip::PinAndMoveAnimation : public TabStrip::TabAnimation { } virtual void AnimationEnded(const Animation* animation) { - tabstrip_->resize_layout_scheduled_ = false; + tabstrip_->needs_resize_layout_ = false; TabStrip::TabAnimation::AnimationEnded(animation); } @@ -714,7 +714,7 @@ TabStrip::TabStrip(TabStripModel* model) : model_(model), resize_layout_factory_(this), added_as_message_loop_observer_(false), - resize_layout_scheduled_(false), + needs_resize_layout_(false), current_unselected_width_(Tab::GetStandardSize().width()), current_selected_width_(Tab::GetStandardSize().width()), available_width_for_tabs_(-1) { @@ -1052,7 +1052,7 @@ void TabStrip::TabSelectedAt(TabContents* old_contents, // We have "tiny tabs" if the tabs are so tiny that the unselected ones are // a different size to the selected ones. bool tiny_tabs = current_unselected_width_ != current_selected_width_; - if (!IsAnimating() && (!resize_layout_scheduled_ || tiny_tabs)) { + if (!IsAnimating() && (!needs_resize_layout_ || tiny_tabs)) { Layout(); } else { SchedulePaint(); @@ -1126,7 +1126,7 @@ void TabStrip::CloseTab(Tab* tab) { // Tabs are not resized until a later time (when the mouse pointer leaves // the TabStrip). available_width_for_tabs_ = GetAvailableWidthForTabs(last_tab); - resize_layout_scheduled_ = true; + needs_resize_layout_ = true; AddMessageLoopObserver(); // Note that the next call might not close the tab (because of unload // hanlders or if the delegate veto the close). @@ -1800,7 +1800,7 @@ void TabStrip::GenerateIdealBounds() { void TabStrip::LayoutNewTabButton(double last_tab_right, double unselected_width) { int delta = abs(Round(unselected_width) - Tab::GetStandardSize().width()); - if (delta > 1 && !resize_layout_scheduled_) { + if (delta > 1 && !needs_resize_layout_) { // We're shrinking tabs, so we need to anchor the New Tab button to the // right edge of the TabStrip's bounds, rather than the right edge of the // right-most Tab, otherwise it'll bounce when animating. diff --git a/chrome/browser/views/tabs/tab_strip.h b/chrome/browser/views/tabs/tab_strip.h index 659d015..1a5b844 100644 --- a/chrome/browser/views/tabs/tab_strip.h +++ b/chrome/browser/views/tabs/tab_strip.h @@ -315,8 +315,7 @@ class TabStrip : public views::View, // True if a resize layout animation should be run a short delay after the // mouse exits the TabStrip. - // TODO(beng): (Cleanup) this would be better named "needs_resize_layout_". - bool resize_layout_scheduled_; + bool needs_resize_layout_; // The "New Tab" button. views::ImageButton* newtab_button_; |