Chromium Code Reviews| 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 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2601 if (!urls.empty()) | 2601 if (!urls.empty()) |
| 2602 Send(new ViewHostMsg_UpdateFaviconURL(GetRoutingID(), urls)); | 2602 Send(new ViewHostMsg_UpdateFaviconURL(GetRoutingID(), urls)); |
| 2603 } | 2603 } |
| 2604 | 2604 |
| 2605 void RenderViewImpl::DidStopLoadingIcons() { | 2605 void RenderViewImpl::DidStopLoadingIcons() { |
| 2606 int icon_types = WebIconURL::kTypeFavicon | | 2606 int icon_types = WebIconURL::kTypeFavicon | |
| 2607 WebIconURL::kTypeTouchPrecomposed | WebIconURL::kTypeTouch; | 2607 WebIconURL::kTypeTouchPrecomposed | WebIconURL::kTypeTouch; |
| 2608 | 2608 |
| 2609 // Favicons matter only for the top-level frame. If it is a WebRemoteFrame, | 2609 // Favicons matter only for the top-level frame. If it is a WebRemoteFrame, |
| 2610 // just return early. | 2610 // just return early. |
| 2611 if (webview()->MainFrame()->IsWebRemoteFrame()) | 2611 if (!webview()->MainFrame()->IsWebLocalFrame()) |
|
dcheng
2017/06/02 16:28:15
Maybe this logic should be on RenderFrameImpl. WDY
Łukasz Anforowicz
2017/06/05 22:38:46
Yes - thanks for pointing this out. Done.
| |
| 2612 return; | 2612 return; |
| 2613 | 2613 |
| 2614 WebVector<WebIconURL> icon_urls = | 2614 WebVector<WebIconURL> icon_urls = |
| 2615 webview()->MainFrame()->IconURLs(icon_types); | 2615 webview()->MainFrame()->ToWebLocalFrame()->IconURLs(icon_types); |
| 2616 | 2616 |
| 2617 std::vector<FaviconURL> urls; | 2617 std::vector<FaviconURL> urls; |
| 2618 for (size_t i = 0; i < icon_urls.size(); i++) { | 2618 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 2619 WebURL url = icon_urls[i].GetIconURL(); | 2619 WebURL url = icon_urls[i].GetIconURL(); |
| 2620 std::vector<gfx::Size> sizes; | 2620 std::vector<gfx::Size> sizes; |
| 2621 ConvertToFaviconSizes(icon_urls[i].Sizes(), &sizes); | 2621 ConvertToFaviconSizes(icon_urls[i].Sizes(), &sizes); |
| 2622 if (!url.IsEmpty()) | 2622 if (!url.IsEmpty()) |
| 2623 urls.push_back( | 2623 urls.push_back( |
| 2624 FaviconURL(url, ToFaviconType(icon_urls[i].IconType()), sizes)); | 2624 FaviconURL(url, ToFaviconType(icon_urls[i].IconType()), sizes)); |
| 2625 } | 2625 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2662 input_event.GetCoalescedEventsPointers(), latency_info, | 2662 input_event.GetCoalescedEventsPointers(), latency_info, |
| 2663 dispatch_type); | 2663 dispatch_type); |
| 2664 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 2664 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| 2665 } | 2665 } |
| 2666 idle_user_detector_->ActivityDetected(); | 2666 idle_user_detector_->ActivityDetected(); |
| 2667 return RenderWidget::HandleInputEvent(input_event, latency_info, | 2667 return RenderWidget::HandleInputEvent(input_event, latency_info, |
| 2668 dispatch_type); | 2668 dispatch_type); |
| 2669 } | 2669 } |
| 2670 | 2670 |
| 2671 } // namespace content | 2671 } // namespace content |
| OLD | NEW |