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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 634123002: DidStopLoadingIcons should account for remote main frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a comment. Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 4156 matching lines...) Expand 10 before | Expand all | Expand 10 after
4167 void RenderViewImpl::SendUpdateFaviconURL(const std::vector<FaviconURL>& urls) { 4167 void RenderViewImpl::SendUpdateFaviconURL(const std::vector<FaviconURL>& urls) {
4168 if (!urls.empty()) 4168 if (!urls.empty())
4169 Send(new ViewHostMsg_UpdateFaviconURL(routing_id_, urls)); 4169 Send(new ViewHostMsg_UpdateFaviconURL(routing_id_, urls));
4170 } 4170 }
4171 4171
4172 void RenderViewImpl::DidStopLoadingIcons() { 4172 void RenderViewImpl::DidStopLoadingIcons() {
4173 int icon_types = WebIconURL::TypeFavicon; 4173 int icon_types = WebIconURL::TypeFavicon;
4174 if (TouchEnabled()) 4174 if (TouchEnabled())
4175 icon_types |= WebIconURL::TypeTouchPrecomposed | WebIconURL::TypeTouch; 4175 icon_types |= WebIconURL::TypeTouchPrecomposed | WebIconURL::TypeTouch;
4176 4176
4177 // Favicons matter only for the top-level frame. If it is a WebRemoteFrame,
4178 // just return early.
4179 if (webview()->mainFrame()->isWebRemoteFrame())
4180 return;
4181
4177 WebVector<WebIconURL> icon_urls = 4182 WebVector<WebIconURL> icon_urls =
4178 webview()->mainFrame()->iconURLs(icon_types); 4183 webview()->mainFrame()->iconURLs(icon_types);
4179 4184
4180 std::vector<FaviconURL> urls; 4185 std::vector<FaviconURL> urls;
4181 for (size_t i = 0; i < icon_urls.size(); i++) { 4186 for (size_t i = 0; i < icon_urls.size(); i++) {
4182 WebURL url = icon_urls[i].iconURL(); 4187 WebURL url = icon_urls[i].iconURL();
4183 std::vector<gfx::Size> sizes; 4188 std::vector<gfx::Size> sizes;
4184 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4189 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4185 if (!url.isEmpty()) 4190 if (!url.isEmpty())
4186 urls.push_back( 4191 urls.push_back(
4187 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4192 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4188 } 4193 }
4189 SendUpdateFaviconURL(urls); 4194 SendUpdateFaviconURL(urls);
4190 } 4195 }
4191 4196
4192 } // namespace content 4197 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698