OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 void TabStripGtk::UpdateLoadingAnimations() { | 844 void TabStripGtk::UpdateLoadingAnimations() { |
845 for (int i = 0, index = 0; i < GetTabCount(); ++i, ++index) { | 845 for (int i = 0, index = 0; i < GetTabCount(); ++i, ++index) { |
846 TabGtk* current_tab = GetTabAt(i); | 846 TabGtk* current_tab = GetTabAt(i); |
847 if (current_tab->closing()) { | 847 if (current_tab->closing()) { |
848 --index; | 848 --index; |
849 } else { | 849 } else { |
850 TabRendererGtk::AnimationState state; | 850 TabRendererGtk::AnimationState state; |
851 TabContentsWrapper* contents = model_->GetTabContentsAt(index); | 851 TabContentsWrapper* contents = model_->GetTabContentsAt(index); |
852 if (!contents || !contents->tab_contents()->IsLoading()) { | 852 if (!contents || !contents->tab_contents()->IsLoading()) { |
853 state = TabGtk::ANIMATION_NONE; | 853 state = TabGtk::ANIMATION_NONE; |
854 } else if (contents->tab_contents()->waiting_for_response()) { | 854 } else if (contents->tab_contents()->IsWaitingForResponse()) { |
855 state = TabGtk::ANIMATION_WAITING; | 855 state = TabGtk::ANIMATION_WAITING; |
856 } else { | 856 } else { |
857 state = TabGtk::ANIMATION_LOADING; | 857 state = TabGtk::ANIMATION_LOADING; |
858 } | 858 } |
859 if (current_tab->ValidateLoadingAnimation(state)) { | 859 if (current_tab->ValidateLoadingAnimation(state)) { |
860 // Queue the tab's icon area to be repainted. | 860 // Queue the tab's icon area to be repainted. |
861 gfx::Rect favicon_bounds = current_tab->favicon_bounds(); | 861 gfx::Rect favicon_bounds = current_tab->favicon_bounds(); |
862 gtk_widget_queue_draw_area(tabstrip_.get(), | 862 gtk_widget_queue_draw_area(tabstrip_.get(), |
863 favicon_bounds.x() + current_tab->x(), | 863 favicon_bounds.x() + current_tab->x(), |
864 favicon_bounds.y() + current_tab->y(), | 864 favicon_bounds.y() + current_tab->y(), |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2244 } | 2244 } |
2245 | 2245 |
2246 void TabStripGtk::SetNewTabButtonBackground() { | 2246 void TabStripGtk::SetNewTabButtonBackground() { |
2247 SkColor color = theme_service_->GetColor( | 2247 SkColor color = theme_service_->GetColor( |
2248 ThemeService::COLOR_BUTTON_BACKGROUND); | 2248 ThemeService::COLOR_BUTTON_BACKGROUND); |
2249 SkBitmap* background = theme_service_->GetBitmapNamed( | 2249 SkBitmap* background = theme_service_->GetBitmapNamed( |
2250 IDR_THEME_WINDOW_CONTROL_BACKGROUND); | 2250 IDR_THEME_WINDOW_CONTROL_BACKGROUND); |
2251 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK); | 2251 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK); |
2252 newtab_button_->SetBackground(color, background, mask); | 2252 newtab_button_->SetBackground(color, background, mask); |
2253 } | 2253 } |
OLD | NEW |