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 4272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4283 if (titleAttribute) | 4283 if (titleAttribute) |
4284 title = titleAttribute; | 4284 title = titleAttribute; |
4285 if (title) { | 4285 if (title) { |
4286 params.menu_title.reset([title copy]); | 4286 params.menu_title.reset([title copy]); |
4287 } | 4287 } |
4288 NSString* referrerPolicy = element[@"referrerPolicy"]; | 4288 NSString* referrerPolicy = element[@"referrerPolicy"]; |
4289 if (referrerPolicy) { | 4289 if (referrerPolicy) { |
4290 params.referrer_policy = | 4290 params.referrer_policy = |
4291 web::ReferrerPolicyFromString(base::SysNSStringToUTF8(referrerPolicy)); | 4291 web::ReferrerPolicyFromString(base::SysNSStringToUTF8(referrerPolicy)); |
4292 } | 4292 } |
| 4293 NSString* innerText = element[@"innerText"]; |
| 4294 if ([innerText length] > 0) { |
| 4295 params.link_text.reset([innerText copy]); |
| 4296 } |
4293 return params; | 4297 return params; |
4294 } | 4298 } |
4295 | 4299 |
4296 #pragma mark - | 4300 #pragma mark - |
4297 #pragma mark Fullscreen | 4301 #pragma mark Fullscreen |
4298 | 4302 |
4299 - (CGRect)visibleFrame { | 4303 - (CGRect)visibleFrame { |
4300 CGRect frame = [_containerView bounds]; | 4304 CGRect frame = [_containerView bounds]; |
4301 CGFloat headerHeight = [self headerHeight]; | 4305 CGFloat headerHeight = [self headerHeight]; |
4302 frame.origin.y = headerHeight; | 4306 frame.origin.y = headerHeight; |
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5645 } | 5649 } |
5646 | 5650 |
5647 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5651 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
5648 } | 5652 } |
5649 | 5653 |
5650 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5654 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
5651 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5655 return [action.request valueForHTTPHeaderField:@"Referer"]; |
5652 } | 5656 } |
5653 | 5657 |
5654 @end | 5658 @end |
OLD | NEW |