Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "ios/web/web_state/ui/crw_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_web_controller.h" |
| 6 | 6 |
| 7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 | 8 |
| 9 #import <objc/runtime.h> | 9 #import <objc/runtime.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 2545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2556 } | 2556 } |
| 2557 if (!favicon->GetString("rel", &rel)) { | 2557 if (!favicon->GetString("rel", &rel)) { |
| 2558 DLOG(WARNING) << "JS message parameter not found: rel"; | 2558 DLOG(WARNING) << "JS message parameter not found: rel"; |
| 2559 return NO; | 2559 return NO; |
| 2560 } | 2560 } |
| 2561 web::FaviconURL::IconType icon_type = web::FaviconURL::FAVICON; | 2561 web::FaviconURL::IconType icon_type = web::FaviconURL::FAVICON; |
| 2562 if (rel == "apple-touch-icon") | 2562 if (rel == "apple-touch-icon") |
| 2563 icon_type = web::FaviconURL::TOUCH_ICON; | 2563 icon_type = web::FaviconURL::TOUCH_ICON; |
| 2564 else if (rel == "apple-touch-icon-precomposed") | 2564 else if (rel == "apple-touch-icon-precomposed") |
| 2565 icon_type = web::FaviconURL::TOUCH_PRECOMPOSED_ICON; | 2565 icon_type = web::FaviconURL::TOUCH_PRECOMPOSED_ICON; |
| 2566 urls.push_back( | 2566 GURL url = GURL(href); |
|
Eugene But (OOO till 7-30)
2017/05/12 15:04:08
WebContentsObserver also has DidUpdateFaviconURL.
gambard
2017/05/12 15:43:39
There is a check if the URL is empty https://cs.ch
| |
| 2567 web::FaviconURL(GURL(href), icon_type, std::vector<gfx::Size>())); | 2567 if (url.is_valid()) { |
| 2568 urls.push_back(web::FaviconURL(url, icon_type, std::vector<gfx::Size>())); | |
| 2569 } | |
| 2568 } | 2570 } |
| 2569 if (!urls.empty()) | 2571 if (!urls.empty()) |
| 2570 _webStateImpl->OnFaviconUrlUpdated(urls); | 2572 _webStateImpl->OnFaviconUrlUpdated(urls); |
| 2571 return YES; | 2573 return YES; |
| 2572 } | 2574 } |
| 2573 | 2575 |
| 2574 - (BOOL)handleDocumentSubmitMessage:(base::DictionaryValue*)message | 2576 - (BOOL)handleDocumentSubmitMessage:(base::DictionaryValue*)message |
| 2575 context:(NSDictionary*)context { | 2577 context:(NSDictionary*)context { |
| 2576 std::string href; | 2578 std::string href; |
| 2577 if (!message->GetString("href", &href)) { | 2579 if (!message->GetString("href", &href)) { |
| (...skipping 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5161 - (NSUInteger)observerCount { | 5163 - (NSUInteger)observerCount { |
| 5162 DCHECK_EQ(_observerBridges.size(), [_observers count]); | 5164 DCHECK_EQ(_observerBridges.size(), [_observers count]); |
| 5163 return [_observers count]; | 5165 return [_observers count]; |
| 5164 } | 5166 } |
| 5165 | 5167 |
| 5166 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { | 5168 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { |
| 5167 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; | 5169 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; |
| 5168 } | 5170 } |
| 5169 | 5171 |
| 5170 @end | 5172 @end |
| OLD | NEW |