OLD | NEW |
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 Loading... |
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 |
OLD | NEW |