Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Unified Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc

Issue 2217273002: Desaturate the favicon shown in the tab when a network error is encountered (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added change for pinned tabs, reused NetworkState enum for net errors Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.cc » ('j') | chrome/browser/ui/views/tabs/tab.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 0d00ebef770f6e86e76929d267ec50325d3e5155..4388b26f7c8128f341293f65b5372c3614f6cf8b 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -35,6 +35,9 @@
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/navigation_controller.h"
+#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/user_metrics.h"
@@ -54,8 +57,15 @@ namespace {
TabRendererData::NetworkState TabContentsNetworkState(
WebContents* contents) {
- if (!contents || !contents->IsLoadingToDifferentDocument())
+ if (!contents || !contents->IsLoadingToDifferentDocument()) {
+ if (contents) {
sky 2016/08/12 15:29:25 This is mildly awkward because of the !contents 1
edwardjung 2016/08/12 19:29:25 Done.
+ content::NavigationEntry* entry =
+ contents->GetController().GetLastCommittedEntry();
+ if (entry && (entry->GetPageType() == content::PAGE_TYPE_ERROR))
+ return TabRendererData::NETWORK_STATE_ERROR;
+ }
return TabRendererData::NETWORK_STATE_NONE;
+ }
if (contents->IsWaitingForResponse())
return TabRendererData::NETWORK_STATE_WAITING;
return TabRendererData::NETWORK_STATE_LOADING;
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.cc » ('j') | chrome/browser/ui/views/tabs/tab.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698