| Index: content/renderer/render_frame_impl.cc
|
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
| index 8ff540e93bfe07d49b3cacacc4f1a6987ea39c47..a9329ae76aa6cf1055ea4c5fb62beaf31b1f6e31 100644
|
| --- a/content/renderer/render_frame_impl.cc
|
| +++ b/content/renderer/render_frame_impl.cc
|
| @@ -80,6 +80,7 @@
|
| #include "content/public/common/content_features.h"
|
| #include "content/public/common/content_switches.h"
|
| #include "content/public/common/context_menu_params.h"
|
| +#include "content/public/common/favicon_url.h"
|
| #include "content/public/common/file_chooser_file_info.h"
|
| #include "content/public/common/file_chooser_params.h"
|
| #include "content/public/common/isolated_world_ids.h"
|
| @@ -677,6 +678,30 @@ double ConvertToBlinkTime(const base::TimeTicks& time_ticks) {
|
| return (time_ticks - base::TimeTicks()).InSecondsF();
|
| }
|
|
|
| +FaviconURL::IconType ToFaviconType(blink::WebIconURL::Type type) {
|
| + switch (type) {
|
| + case blink::WebIconURL::kTypeFavicon:
|
| + return FaviconURL::IconType::kFavIcon;
|
| + case blink::WebIconURL::kTypeTouch:
|
| + return FaviconURL::IconType::kTouchIcon;
|
| + case blink::WebIconURL::kTypeTouchPrecomposed:
|
| + return FaviconURL::IconType::kTouchPrecomposedIcon;
|
| + case blink::WebIconURL::kTypeInvalid:
|
| + return FaviconURL::IconType::kInvalid;
|
| + }
|
| + NOTREACHED();
|
| + return FaviconURL::IconType::kInvalid;
|
| +}
|
| +
|
| +std::vector<gfx::Size> ConvertToFaviconSizes(
|
| + const blink::WebVector<blink::WebSize>& web_sizes) {
|
| + std::vector<gfx::Size> result;
|
| + result.reserve(web_sizes.size());
|
| + for (const blink::WebSize& web_size : web_sizes)
|
| + result.push_back(gfx::Size(web_size));
|
| + return result;
|
| +}
|
| +
|
| } // namespace
|
|
|
| // The following methods are outside of the anonymous namespace to ensure that
|
| @@ -3767,8 +3792,28 @@ void RenderFrameImpl::DidReceiveTitle(const blink::WebString& title,
|
| }
|
|
|
| void RenderFrameImpl::DidChangeIcon(blink::WebIconURL::Type icon_type) {
|
| - // TODO(nasko): Investigate wheather implementation should move here.
|
| - render_view_->didChangeIcon(frame_, icon_type);
|
| + SendUpdateFaviconURL(icon_type);
|
| +}
|
| +
|
| +void RenderFrameImpl::SendUpdateFaviconURL(
|
| + blink::WebIconURL::Type icon_types_mask) {
|
| + if (frame_->Parent())
|
| + return;
|
| +
|
| + WebVector<blink::WebIconURL> icon_urls = frame_->IconURLs(icon_types_mask);
|
| + if (icon_urls.empty())
|
| + return;
|
| +
|
| + std::vector<FaviconURL> urls;
|
| + urls.reserve(icon_urls.size());
|
| + for (const blink::WebIconURL& icon_url : icon_urls) {
|
| + urls.push_back(FaviconURL(icon_url.GetIconURL(),
|
| + ToFaviconType(icon_url.IconType()),
|
| + ConvertToFaviconSizes(icon_url.Sizes())));
|
| + }
|
| + DCHECK_EQ(icon_urls.size(), urls.size());
|
| +
|
| + Send(new FrameHostMsg_UpdateFaviconURL(GetRoutingID(), urls));
|
| }
|
|
|
| void RenderFrameImpl::DidFinishDocumentLoad() {
|
| @@ -5011,6 +5056,13 @@ void RenderFrameImpl::DidStopLoading() {
|
| // this state anymore.
|
| history_subframe_unique_names_.clear();
|
|
|
| + blink::WebIconURL::Type icon_types_mask =
|
| + static_cast<blink::WebIconURL::Type>(
|
| + blink::WebIconURL::kTypeFavicon |
|
| + blink::WebIconURL::kTypeTouchPrecomposed |
|
| + blink::WebIconURL::kTypeTouch);
|
| + SendUpdateFaviconURL(icon_types_mask);
|
| +
|
| render_view_->FrameDidStopLoading(frame_);
|
| Send(new FrameHostMsg_DidStopLoading(routing_id_));
|
| }
|
|
|