diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-06 21:30:27 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-06 21:30:27 +0000 |
commit | b2204fb914f96e9cc505c640aeb7986b25124ca0 (patch) | |
tree | d9b7ac644fd6e38d2570c5daf501fc2a6ae7ea6b /chrome/browser/gtk/tabs/tab_strip_gtk.cc | |
parent | b62b752c86847826f3fd20b9aaf09a409ebac61d (diff) | |
download | chromium_src-b2204fb914f96e9cc505c640aeb7986b25124ca0.zip chromium_src-b2204fb914f96e9cc505c640aeb7986b25124ca0.tar.gz chromium_src-b2204fb914f96e9cc505c640aeb7986b25124ca0.tar.bz2 |
Implement loading animations. I've ignored the app mode and popup cases since I don't think the Linux port supports those modes yet. I also ignored RTL. I've made some minor lint/style cleanups along the way.
BUG=9380
Review URL: http://codereview.chromium.org/60104
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13195 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tabs/tab_strip_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index 7e9a153..1c0e5c4 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -102,6 +102,26 @@ void TabStripGtk::Layout() { gtk_widget_queue_draw(tabstrip_.get()); } +void TabStripGtk::UpdateLoadingAnimations() { + for (int i = 0, index = 0; i < GetTabCount(); ++i, ++index) { + TabGtk* current_tab = GetTabAt(i); + if (current_tab->closing()) { + --index; + } else { + TabContents* contents = model_->GetTabContentsAt(index); + if (!contents || !contents->is_loading()) { + current_tab->ValidateLoadingAnimation(TabGtk::ANIMATION_NONE); + } else if (contents->waiting_for_response()) { + current_tab->ValidateLoadingAnimation(TabGtk::ANIMATION_WAITING); + } else { + current_tab->ValidateLoadingAnimation(TabGtk::ANIMATION_LOADING); + } + } + } + + gtk_widget_queue_draw(tabstrip_.get()); +} + //////////////////////////////////////////////////////////////////////////////// // TabStripGtk, TabStripModelObserver implementation: @@ -294,7 +314,8 @@ int TabStripGtk::GetIndexOfTab(const TabGtk* tab) const { } TabGtk* TabStripGtk::GetTabAt(int index) const { - DCHECK(index >= 0 && index < GetTabCount()); + DCHECK_GE(index, 0); + DCHECK_LT(index, GetTabCount()); return tab_data_.at(index).tab; } |