| Index: chrome/browser/ui/views/tabs/tab.cc
|
| diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
|
| index cfa5c85889bdfbfa54aa00e7ddd748e259bbc629..6d1a36082e0b092d93e042ace7f7f422548a91c3 100644
|
| --- a/chrome/browser/ui/views/tabs/tab.cc
|
| +++ b/chrome/browser/ui/views/tabs/tab.cc
|
| @@ -116,11 +116,6 @@ const int kImmersiveLoadingStepCount = 32;
|
|
|
| const char kTabCloseButtonName[] = "TabCloseButton";
|
|
|
| -// Desaturate favicon HSL shift values.
|
| -const double kDesaturateHue = -1.0;
|
| -const double kDesaturateSaturation = 0.0;
|
| -const double kDesaturateLightness = 0.6;
|
| -
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // ImageCacheEntryMetadata
|
| //
|
| @@ -458,26 +453,6 @@ void PaintTabFill(gfx::Canvas* canvas,
|
| tab_insets.top(), rect.width(), rect.height());
|
| }
|
|
|
| -// Desaturates the favicon. Should only be used for when a tab encounters a
|
| -// network error state.
|
| -void PaintDesaturatedFavIcon(gfx::Canvas* canvas,
|
| - gfx::ImageSkia& favicon,
|
| - const gfx::Rect& bounds) {
|
| - color_utils::HSL shift = {kDesaturateHue,
|
| - kDesaturateSaturation,
|
| - kDesaturateLightness};
|
| - gfx::ImageSkia desaturated_favicon =
|
| - gfx::ImageSkiaOperations::CreateHSLShiftedImage(favicon, shift);
|
| - if (!bounds.IsEmpty()) {
|
| - canvas->DrawImageInt(desaturated_favicon, 0, 0,
|
| - bounds.width(), bounds.height(),
|
| - bounds.x(), bounds.y(), bounds.width(),
|
| - bounds.height(), false);
|
| - } else {
|
| - canvas->DrawImageInt(desaturated_favicon, 0, 0);
|
| - }
|
| -}
|
| -
|
| } // namespace
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| @@ -659,8 +634,7 @@ bool Tab::ThrobberView::CanProcessEventsWithinSubtree() const {
|
|
|
| void Tab::ThrobberView::OnPaint(gfx::Canvas* canvas) {
|
| const TabRendererData::NetworkState state = owner_->data().network_state;
|
| - if (state == TabRendererData::NETWORK_STATE_NONE ||
|
| - state == TabRendererData::NETWORK_STATE_ERROR)
|
| + if (state == TabRendererData::NETWORK_STATE_NONE)
|
| return;
|
|
|
| const ui::ThemeProvider* tp = GetThemeProvider();
|
| @@ -798,6 +772,7 @@ bool Tab::IsSelected() const {
|
|
|
| void Tab::SetData(const TabRendererData& data) {
|
| DCHECK(GetWidget());
|
| +
|
| if (data_.Equals(data))
|
| return;
|
|
|
| @@ -839,10 +814,9 @@ void Tab::SetData(const TabRendererData& data) {
|
|
|
| void Tab::UpdateLoadingAnimation(TabRendererData::NetworkState state) {
|
| if (state == data_.network_state &&
|
| - (state == TabRendererData::NETWORK_STATE_NONE ||
|
| - state == TabRendererData::NETWORK_STATE_ERROR)) {
|
| - // If the network state is none or is an network error and hasn't changed,
|
| - // do nothing. Otherwise we need to advance the animation frame.
|
| + state == TabRendererData::NETWORK_STATE_NONE) {
|
| + // If the network state is none and hasn't changed, do nothing. Otherwise we
|
| + // need to advance the animation frame.
|
| return;
|
| }
|
|
|
| @@ -1573,12 +1547,7 @@ void Tab::PaintPinnedTabTitleChangedIndicatorAndIcon(
|
| const float kIndicatorCropRadius = 4.5;
|
| gfx::Canvas icon_canvas(gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize),
|
| canvas->image_scale(), false);
|
| -
|
| - if (data().network_state == TabRendererData::NETWORK_STATE_ERROR)
|
| - PaintDesaturatedFavIcon(&icon_canvas, favicon_, gfx::Rect());
|
| - else
|
| - icon_canvas.DrawImageInt(favicon_, 0, 0);
|
| -
|
| + icon_canvas.DrawImageInt(favicon_, 0, 0);
|
| SkPaint clear_paint;
|
| clear_paint.setAntiAlias(true);
|
| clear_paint.setXfermodeMode(SkXfermode::kClear_Mode);
|
| @@ -1615,8 +1584,7 @@ void Tab::PaintIcon(gfx::Canvas* canvas) {
|
| return;
|
|
|
| // Throbber will do its own painting.
|
| - if (data().network_state != TabRendererData::NETWORK_STATE_NONE &&
|
| - data().network_state != TabRendererData::NETWORK_STATE_ERROR)
|
| + if (data().network_state != TabRendererData::NETWORK_STATE_NONE)
|
| return;
|
|
|
| // Ensure that |favicon_| is created.
|
| @@ -1642,14 +1610,9 @@ void Tab::PaintIcon(gfx::Canvas* canvas) {
|
| !should_display_crashed_favicon_) {
|
| PaintPinnedTabTitleChangedIndicatorAndIcon(canvas, bounds);
|
| } else if (!favicon_.isNull()) {
|
| - // Desaturate favicons of tabs with network errors.
|
| - if (data().network_state == TabRendererData::NETWORK_STATE_ERROR) {
|
| - PaintDesaturatedFavIcon(canvas, favicon_, bounds);
|
| - } else {
|
| - canvas->DrawImageInt(favicon_, 0, 0, bounds.width(), bounds.height(),
|
| - bounds.x(), bounds.y(), bounds.width(),
|
| - bounds.height(), false);
|
| - }
|
| + canvas->DrawImageInt(favicon_, 0, 0, bounds.width(), bounds.height(),
|
| + bounds.x(), bounds.y(), bounds.width(),
|
| + bounds.height(), false);
|
| }
|
| }
|
|
|
| @@ -1673,8 +1636,7 @@ void Tab::AdvanceLoadingAnimation() {
|
| return;
|
| }
|
|
|
| - if (state == TabRendererData::NETWORK_STATE_NONE ||
|
| - state == TabRendererData::NETWORK_STATE_ERROR) {
|
| + if (state == TabRendererData::NETWORK_STATE_NONE) {
|
| throbber_->ResetStartTimes();
|
| throbber_->SetVisible(false);
|
| ScheduleIconPaint();
|
|
|