Index: ios/chrome/browser/dom_distiller/distiller_favicon_driver.mm |
diff --git a/ios/chrome/browser/dom_distiller/distiller_favicon_driver.mm b/ios/chrome/browser/dom_distiller/distiller_favicon_driver.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0f3326bf4deae4e7bf89ee5b855b15b9517b40d1 |
--- /dev/null |
+++ b/ios/chrome/browser/dom_distiller/distiller_favicon_driver.mm |
@@ -0,0 +1,39 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#import "ios/chrome/browser/dom_distiller/distiller_favicon_driver.h" |
+ |
+#include "components/favicon/core/favicon_url.h" |
+#include "components/favicon/ios/favicon_url_util.h" |
+#include "url/gurl.h" |
+ |
+void DistillerFaviconDriver::CreateForWebState( |
+ web::WebState* web_state, |
+ favicon::FaviconService* favicon_service, |
+ history::HistoryService* history_service, |
+ bookmarks::BookmarkModel* bookmark_model, |
+ const GURL& url) { |
+ if (FromWebState(web_state)) |
+ return; |
+ |
+ web_state->SetUserData(UserDataKey(), |
+ new DistillerFaviconDriver(web_state, favicon_service, |
+ history_service, bookmark_model, url)); |
+} |
+ |
+ |
+DistillerFaviconDriver::DistillerFaviconDriver(web::WebState* web_state, |
+ favicon::FaviconService* favicon_service, |
+ history::HistoryService* history_service, |
+ bookmarks::BookmarkModel* bookmark_model, const GURL& url) |
+: favicon::WebFaviconDriver(web_state, favicon_service, history_service, bookmark_model),url_(url) { |
+} |
+ |
+DistillerFaviconDriver::~DistillerFaviconDriver() { |
+} |
+ |
+void DistillerFaviconDriver::FaviconUrlUpdated( |
+ const std::vector<web::FaviconURL>& candidates) { |
+ OnUpdateFaviconURL(url_, favicon::FaviconURLsFromWebFaviconURLs(candidates)); |
+} |