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

Side by Side Diff: chrome/browser/extensions/favicon_downloader.cc

Issue 2918903002: Move IconURLs method from WebFrame to WebLocalFrame (Closed)
Patch Set: s/kFavIcon/kFavicon/g (as suggested in CR feedback from pkotwicz@). Created 3 years, 6 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/favicon_downloader.h" 5 #include "chrome/browser/extensions/favicon_downloader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "components/favicon/content/content_favicon_driver.h" 8 #include "components/favicon/content/content_favicon_driver.h"
9 #include "content/public/browser/navigation_handle.h" 9 #include "content/public/browser/navigation_handle.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return content_favicon_driver ? content_favicon_driver->favicon_urls() 66 return content_favicon_driver ? content_favicon_driver->favicon_urls()
67 : std::vector<content::FaviconURL>(); 67 : std::vector<content::FaviconURL>();
68 } 68 }
69 69
70 void FaviconDownloader::FetchIcons( 70 void FaviconDownloader::FetchIcons(
71 const std::vector<content::FaviconURL>& favicon_urls) { 71 const std::vector<content::FaviconURL>& favicon_urls) {
72 std::vector<GURL> urls; 72 std::vector<GURL> urls;
73 for (std::vector<content::FaviconURL>::const_iterator it = 73 for (std::vector<content::FaviconURL>::const_iterator it =
74 favicon_urls.begin(); 74 favicon_urls.begin();
75 it != favicon_urls.end(); ++it) { 75 it != favicon_urls.end(); ++it) {
76 if (it->icon_type != content::FaviconURL::INVALID_ICON) 76 if (it->icon_type != content::FaviconURL::IconType::kInvalid)
77 urls.push_back(it->icon_url); 77 urls.push_back(it->icon_url);
78 } 78 }
79 FetchIcons(urls); 79 FetchIcons(urls);
80 } 80 }
81 81
82 void FaviconDownloader::FetchIcons(const std::vector<GURL>& urls) { 82 void FaviconDownloader::FetchIcons(const std::vector<GURL>& urls) {
83 // Download icons; put their download ids into |in_progress_requests_| and 83 // Download icons; put their download ids into |in_progress_requests_| and
84 // their urls into |processed_urls_|. 84 // their urls into |processed_urls_|.
85 for (std::vector<GURL>::const_iterator it = urls.begin(); 85 for (std::vector<GURL>::const_iterator it = urls.begin();
86 it != urls.end(); ++it) { 86 it != urls.end(); ++it) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 void FaviconDownloader::DidUpdateFaviconURL( 127 void FaviconDownloader::DidUpdateFaviconURL(
128 const std::vector<content::FaviconURL>& candidates) { 128 const std::vector<content::FaviconURL>& candidates) {
129 // Only consider the first candidates we are given. This prevents pages that 129 // Only consider the first candidates we are given. This prevents pages that
130 // change their favicon from spamming us. 130 // change their favicon from spamming us.
131 if (!need_favicon_urls_) 131 if (!need_favicon_urls_)
132 return; 132 return;
133 133
134 need_favicon_urls_ = false; 134 need_favicon_urls_ = false;
135 FetchIcons(candidates); 135 FetchIcons(candidates);
136 } 136 }
OLDNEW
« no previous file with comments | « android_webview/browser/icon_helper.cc ('k') | chrome/browser/extensions/favicon_downloader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698