Index: chrome/browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc |
diff --git a/chrome/browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc b/chrome/browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc |
index cd1173ced6e9af594db3c0aee1b44de311018923..8b83392471ea09520d6f58c60d2081e7f0a2d103 100644 |
--- a/chrome/browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc |
+++ b/chrome/browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc |
@@ -11,24 +11,28 @@ |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/browser_tabstrip.h" |
#include "chrome/browser/ui/views/frame/browser_view.h" |
-#include "chrome/common/favicon_url.h" |
-#include "chrome/common/icon_messages.h" |
#include "chrome/test/base/in_process_browser_test.h" |
#include "chrome/test/base/ui_test_utils.h" |
+#include "content/public/browser/favicon_download_delegate.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_delegate.h" |
#include "content/public/browser/web_contents_observer.h" |
+#include "content/public/common/favicon_url.h" |
#include "net/test/test_server.h" |
#include "testing/gtest/include/gtest/gtest.h" |
+using content::FaviconURL; |
+ |
+using content::FaviconURL; |
+ |
namespace { |
// Observer class to determine when favicons have completed loading. |
-class ContentsObserver : public content::WebContentsObserver { |
+class ContentsObserver : public content::FaviconDownloadDelegate { |
public: |
explicit ContentsObserver(content::WebContents* web_contents) |
- : content::WebContentsObserver(web_contents), |
- got_favicons_(false) { |
+ : got_favicons_(false) { |
+ web_contents->RegisterFaviconDelegate(this); |
} |
virtual ~ContentsObserver() {} |
@@ -38,23 +42,14 @@ class ContentsObserver : public content::WebContentsObserver { |
got_favicons_ = false; |
} |
- // content::WebContentsObserver overrides. |
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { |
- bool message_handled = false; // Allow other handlers to receive these. |
- IPC_BEGIN_MESSAGE_MAP(ContentsObserver, message) |
- IPC_MESSAGE_HANDLER(IconHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) |
- IPC_MESSAGE_UNHANDLED(message_handled = false) |
- IPC_END_MESSAGE_MAP() |
- return message_handled; |
- } |
- |
- private: |
- void OnUpdateFaviconURL(int32 page_id, |
+ // content::FaviconDownloadDelegate overrides. |
+ void UpdateFaviconURL(int32 page_id, |
const std::vector<FaviconURL>& candidates) { |
if (!candidates.empty()) |
got_favicons_ = true; |
} |
+ private: |
bool got_favicons_; |
}; |