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

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

Issue 2321833002: [Mac] Desaturate the Favicon for Network Errors (Closed)
Patch Set: Fix for Views Created 4 years, 3 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 | « chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.mm ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »
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 4253caaaf19e16b453b294155a9835eaf6e037a3..2ccde24b61c8fcfdca90521242e50a2a2a1b6ddd 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -28,16 +28,12 @@
#include "chrome/browser/ui/views/tabs/tab_strip.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "components/favicon/content/content_favicon_driver.h"
#include "components/metrics/proto/omnibox_event.pb.h"
#include "components/mime_util/mime_util.h"
#include "components/omnibox/browser/autocomplete_classifier.h"
#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"
@@ -57,15 +53,8 @@ namespace {
TabRendererData::NetworkState TabContentsNetworkState(
WebContents* contents) {
- if (!contents)
+ if (!contents || !contents->IsLoadingToDifferentDocument())
return TabRendererData::NETWORK_STATE_NONE;
- if (!contents->IsLoadingToDifferentDocument()) {
- 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;
@@ -501,10 +490,7 @@ void BrowserTabStripController::SetTabRendererDataFromModel(
int model_index,
TabRendererData* data,
TabStatus tab_status) {
- favicon::FaviconDriver* favicon_driver =
- favicon::ContentFaviconDriver::FromWebContents(contents);
-
- data->favicon = favicon_driver->GetFavicon().AsImageSkia();
+ data->favicon = favicon::TabFaviconFromWebContents(contents).AsImageSkia();
data->network_state = TabContentsNetworkState(contents);
data->title = contents->GetTitle();
data->url = contents->GetURL();
« no previous file with comments | « chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.mm ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698