summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-12 00:00:27 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-12 00:00:27 +0000
commit6ea919c047daa73c23a7d46a59eeef0699c98c6f (patch)
treefe0b375d8564d2de349bab07bcb44fd880ee445a
parenta36d0ef9d3674c273d10dfc3e2352d6ab1d0e9f2 (diff)
downloadchromium_src-6ea919c047daa73c23a7d46a59eeef0699c98c6f.zip
chromium_src-6ea919c047daa73c23a7d46a59eeef0699c98c6f.tar.gz
chromium_src-6ea919c047daa73c23a7d46a59eeef0699c98c6f.tar.bz2
Removes TabStrip::CanUpdateDisplay as it lead to crashes on the
windows side. BUG=24132 TEST=none Review URL: http://codereview.chromium.org/372068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31736 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.cc47
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.h6
2 files changed, 16 insertions, 37 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
index 7b85532..67f9020 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
@@ -964,14 +964,12 @@ void TabStripGtk::TabInsertedAt(TabContents* contents,
}
void TabStripGtk::TabDetachedAt(TabContents* contents, int index) {
- if (CanUpdateDisplay()) {
- GenerateIdealBounds();
- StartRemoveTabAnimation(index, contents);
- // Have to do this _after_ calling StartRemoveTabAnimation, so that any
- // previous remove is completed fully and index is valid in sync with the
- // model index.
- GetTabAt(index)->set_closing(true);
- }
+ GenerateIdealBounds();
+ StartRemoveTabAnimation(index, contents);
+ // Have to do this _after_ calling StartRemoveTabAnimation, so that any
+ // previous remove is completed fully and index is valid in sync with the
+ // model index.
+ GetTabAt(index)->set_closing(true);
}
void TabStripGtk::TabSelectedAt(TabContents* old_contents,
@@ -980,20 +978,18 @@ void TabStripGtk::TabSelectedAt(TabContents* old_contents,
bool user_gesture) {
DCHECK(index >= 0 && index < static_cast<int>(GetTabCount()));
- if (CanUpdateDisplay()) {
- // 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))
- Layout();
+ // 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))
+ Layout();
- GetTabAt(index)->SchedulePaint();
+ GetTabAt(index)->SchedulePaint();
- int old_index = model_->GetIndexOfTabContents(old_contents);
- if (old_index >= 0) {
- GetTabAt(old_index)->SchedulePaint();
- GetTabAt(old_index)->StopPinnedTabTitleAnimation();
- }
+ int old_index = model_->GetIndexOfTabContents(old_contents);
+ if (old_index >= 0) {
+ GetTabAt(old_index)->SchedulePaint();
+ GetTabAt(old_index)->StopPinnedTabTitleAnimation();
}
}
@@ -1778,17 +1774,6 @@ void TabStripGtk::StartPinAndMoveTabAnimation(int from_index,
active_animation_->Start();
}
-bool TabStripGtk::CanUpdateDisplay() {
- // Don't bother laying out/painting when we're closing all tabs.
- if (model_->closing_all()) {
- // Make sure any active animation is ended, too.
- if (active_animation_.get())
- active_animation_->Stop();
- return false;
- }
- return true;
-}
-
void TabStripGtk::FinishAnimation(TabStripGtk::TabAnimation* animation,
bool layout) {
active_animation_.reset(NULL);
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.h b/chrome/browser/gtk/tabs/tab_strip_gtk.h
index c13ceca..3204433 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.h
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.h
@@ -380,12 +380,6 @@ class TabStripGtk : public TabStripModelObserver,
void StartPinAndMoveTabAnimation(int from_index, int to_index,
const gfx::Rect& start_bounds);
- // Returns true if detach or select changes in the model should be reflected
- // in the TabStrip. This returns false if we're closing all tabs in the
- // TabStrip and so we should prevent updating. This is not const because we
- // use this as a signal to cancel any active animations.
- bool CanUpdateDisplay();
-
// Notifies the TabStrip that the specified TabAnimation has completed.
// Optionally a full Layout will be performed, specified by |layout|.
void FinishAnimation(TabAnimation* animation, bool layout);