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

Unified Diff: chrome/browser/task_management/providers/web_contents/tab_contents_tag_browsertest.cc

Issue 1407353012: Refactor FaviconDriver::OnFaviconAvailable() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@initial_simplify
Patch Set: Created 5 years, 1 month 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
Index: chrome/browser/task_management/providers/web_contents/tab_contents_tag_browsertest.cc
diff --git a/chrome/browser/task_management/providers/web_contents/tab_contents_tag_browsertest.cc b/chrome/browser/task_management/providers/web_contents/tab_contents_tag_browsertest.cc
index 796b2a6b377b498e8c6858d7dc06886343fb0d0a..7dfa845ed6ae0ea81713d43b9666b494522dd3e0 100644
--- a/chrome/browser/task_management/providers/web_contents/tab_contents_tag_browsertest.cc
+++ b/chrome/browser/task_management/providers/web_contents/tab_contents_tag_browsertest.cc
@@ -15,6 +15,8 @@
#include "components/favicon/content/content_favicon_driver.h"
#include "components/favicon/core/favicon_driver.h"
#include "components/favicon/core/favicon_driver_observer.h"
+#include "content/public/browser/favicon_status.h"
+#include "content/public/browser/navigation_entry.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/page_transition_types.h"
@@ -72,7 +74,7 @@ class FaviconWaiter : public favicon::FaviconDriverObserver {
}
void WaitForFaviconWithURL(const GURL& url) {
- if (driver_->GetActiveFaviconURL() == url) {
+ if (GetCurrentFaviconURL() == url) {
driver_->RemoveObserver(this);
return;
}
@@ -84,11 +86,20 @@ class FaviconWaiter : public favicon::FaviconDriverObserver {
}
private:
- void OnFaviconAvailable(const gfx::Image& image) override {}
+ GURL GetCurrentFaviconURL() {
+ const content::NavigationController& controller =
+ driver_->web_contents()->GetController();
+ content::NavigationEntry* entry = controller.GetLastCommittedEntry();
+ return entry ? entry->GetFavicon().url : GURL();
+ }
- void OnFaviconUpdated(favicon::FaviconDriver* driver,
- bool icon_url_changed) override {
- if (driver_->GetActiveFaviconURL() == target_favicon_url_) {
+ void OnFaviconUpdated(favicon::FaviconDriver* favicon_driver,
+ NotificationIconType notification_icon_type,
+ const GURL& icon_url,
+ bool icon_url_changed,
+ const gfx::Image& image) override {
+ if (notification_icon_type == NON_TOUCH_16_DIP &&
+ icon_url == target_favicon_url_) {
driver_->RemoveObserver(this);
if (!quit_closure_.is_null())

Powered by Google App Engine
This is Rietveld 408576698