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

Unified Diff: ios/chrome/browser/dom_distiller/distiller_favicon_driver.mm

Issue 2541093002: DO NOT COMMIT (Closed)
Patch Set: Created 4 years 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: 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));
+}

Powered by Google App Engine
This is Rietveld 408576698