OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/chrome/browser/dom_distiller/distiller_favicon_driver.h" |
| 6 |
| 7 #include "components/favicon/core/favicon_url.h" |
| 8 #include "components/favicon/ios/favicon_url_util.h" |
| 9 #include "url/gurl.h" |
| 10 |
| 11 void DistillerFaviconDriver::CreateForWebState( |
| 12 web::WebState* web_state, |
| 13 favicon::FaviconService* favicon_servic
e, |
| 14 history::HistoryService* history_servic
e, |
| 15 bookmarks::BookmarkModel* bookmark_mode
l, |
| 16 const GURL& url) { |
| 17 if (FromWebState(web_state)) |
| 18 return; |
| 19 |
| 20 web_state->SetUserData(UserDataKey(), |
| 21 new DistillerFaviconDriver(web_state, favicon_service, |
| 22 history_service, bookmark_model, u
rl)); |
| 23 } |
| 24 |
| 25 |
| 26 DistillerFaviconDriver::DistillerFaviconDriver(web::WebState* web_state, |
| 27 favicon::FaviconService* favicon_
service, |
| 28 history::HistoryService* history_service, |
| 29 bookmarks::BookmarkModel* bookmark_model, con
st GURL& url) |
| 30 : favicon::WebFaviconDriver(web_state, favicon_service, history_service, bookmar
k_model),url_(url) { |
| 31 } |
| 32 |
| 33 DistillerFaviconDriver::~DistillerFaviconDriver() { |
| 34 } |
| 35 |
| 36 void DistillerFaviconDriver::FaviconUrlUpdated( |
| 37 const std::vector<web::FaviconURL>& can
didates) { |
| 38 OnUpdateFaviconURL(url_, favicon::FaviconURLsFromWebFaviconURLs(candidates)); |
| 39 } |
OLD | NEW |