| 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 4b854bcfbe4b1bf089ab06e6bbaf58f9954d4cd4..fa4554d56d6d7d17ed67090d25d2f96e332c423a 100644
|
| --- a/chrome/browser/ui/views/tabs/tab.cc
|
| +++ b/chrome/browser/ui/views/tabs/tab.cc
|
| @@ -31,6 +31,7 @@
|
| #include "grit/components_strings.h"
|
| #include "grit/theme_resources.h"
|
| #include "third_party/skia/include/effects/SkGradientShader.h"
|
| +#include "third_party/skia/include/effects/SkLumaColorFilter.h"
|
| #include "third_party/skia/include/pathops/SkPathOps.h"
|
| #include "ui/accessibility/ax_view_state.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| @@ -897,7 +898,6 @@ bool Tab::IsSelected() const {
|
|
|
| void Tab::SetData(const TabRendererData& data) {
|
| DCHECK(GetWidget());
|
| -
|
| if (data_.Equals(data))
|
| return;
|
|
|
| @@ -1657,9 +1657,25 @@ void Tab::PaintIcon(gfx::Canvas* canvas) {
|
| !should_display_crashed_favicon_) {
|
| PaintPinnedTabTitleChangedIndicatorAndIcon(canvas, bounds);
|
| } else if (!favicon_.isNull()) {
|
| - canvas->DrawImageInt(favicon_, 0, 0, bounds.width(), bounds.height(),
|
| - bounds.x(), bounds.y(), bounds.width(),
|
| - bounds.height(), false);
|
| + // Desaturate favicons of tabs with network errors.
|
| + if (data().network_error) {
|
| + SkPaint paint;
|
| + paint.setStyle(SkPaint::kFill_Style);
|
| + paint.setAntiAlias(true);
|
| + SkScalar desaturate[20] = {0.3086f, 0.6094f, 0.0820f, 0.0f, 0.0f,
|
| + 0.3086f, 0.6094f, 0.0820f, 0.0f, 0.0f,
|
| + 0.3086f, 0.6094f, 0.0820f, 0.0f, 0.0f,
|
| + 0.0f, 0.0f, 0.0f, 0.8f, 0.0f};
|
| + paint.setColorFilter(
|
| + SkColorFilter::MakeMatrixFilterRowMajor255(desaturate));
|
| + canvas->DrawImageInt(favicon_, 0, 0, bounds.width(), bounds.height(),
|
| + bounds.x(), bounds.y(), bounds.width(),
|
| + bounds.height(), false, paint);
|
| + } else {
|
| + canvas->DrawImageInt(favicon_, 0, 0, bounds.width(), bounds.height(),
|
| + bounds.x(), bounds.y(), bounds.width(),
|
| + bounds.height(), false);
|
| + }
|
| }
|
| }
|
|
|
|
|