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/chrome/browser/tabs/tab.h" | 5 #import "ios/chrome/browser/tabs/tab.h" |
6 | 6 |
7 #import <CoreLocation/CoreLocation.h> | 7 #import <CoreLocation/CoreLocation.h> |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 - (void)showResubmitDataActionSheet { | 1756 - (void)showResubmitDataActionSheet { |
1757 // Return early if the CRWWebController has been closed or web | 1757 // Return early if the CRWWebController has been closed or web |
1758 // usage is disabled on it. | 1758 // usage is disabled on it. |
1759 if (![self.webController webUsageEnabled]) | 1759 if (![self.webController webUsageEnabled]) |
1760 return; | 1760 return; |
1761 // Check to see if an action sheet can be shown. | 1761 // Check to see if an action sheet can be shown. |
1762 if (self.webState && [self.webState->GetView() window]) { | 1762 if (self.webState && [self.webState->GetView() window]) { |
1763 // Display the action sheet with the arrow pointing at the top center of the | 1763 // Display the action sheet with the arrow pointing at the top center of the |
1764 // web contents. | 1764 // web contents. |
1765 CGFloat xOrigin = CGRectGetMidX(self.webState->GetView().frame); | 1765 CGFloat xOrigin = CGRectGetMidX(self.webState->GetView().frame); |
1766 CGFloat yOrigin = CGRectGetMinY(self.webState->GetView().frame) + | 1766 CGFloat yOrigin = |
1767 [[self fullScreenControllerDelegate] headerHeight]; | 1767 CGRectGetMinY(self.webState->GetView().frame) + |
| 1768 [[self fullScreenControllerDelegate] headerHeightForTab:self]; |
1768 [resubmitDataController_ | 1769 [resubmitDataController_ |
1769 presentActionSheetFromRect:CGRectMake(xOrigin, yOrigin, 1, 1) | 1770 presentActionSheetFromRect:CGRectMake(xOrigin, yOrigin, 1, 1) |
1770 inView:self.webState->GetView()]; | 1771 inView:self.webState->GetView()]; |
1771 showResubmitDataActionSheetAttempt_ = 0; | 1772 showResubmitDataActionSheetAttempt_ = 0; |
1772 return; | 1773 return; |
1773 } | 1774 } |
1774 | 1775 |
1775 // The resubmit data action cannot be presented as the |contentView_| was not | 1776 // The resubmit data action cannot be presented as the |contentView_| was not |
1776 // yet added to the window. Retry after |kDelayBetweenAttemptsNanoSecs|. | 1777 // yet added to the window. Retry after |kDelayBetweenAttemptsNanoSecs|. |
1777 // TODO(crbug.com/227868): The strategy to poll until the resubmit data action | 1778 // TODO(crbug.com/227868): The strategy to poll until the resubmit data action |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2190 | 2191 |
2191 return setting != CONTENT_SETTING_ALLOW; | 2192 return setting != CONTENT_SETTING_ALLOW; |
2192 } | 2193 } |
2193 | 2194 |
2194 - (void)webController:(CRWWebController*)webController | 2195 - (void)webController:(CRWWebController*)webController |
2195 didBlockPopup:(const web::BlockedPopupInfo&)blockedPopupInfo { | 2196 didBlockPopup:(const web::BlockedPopupInfo&)blockedPopupInfo { |
2196 [self popupHandler]->HandlePopup(blockedPopupInfo); | 2197 [self popupHandler]->HandlePopup(blockedPopupInfo); |
2197 } | 2198 } |
2198 | 2199 |
2199 - (CGFloat)headerHeightForWebController:(CRWWebController*)webController { | 2200 - (CGFloat)headerHeightForWebController:(CRWWebController*)webController { |
2200 return [fullScreenControllerDelegate_ headerHeight]; | 2201 DCHECK(webController == [self webController]); |
| 2202 return [fullScreenControllerDelegate_ headerHeightForTab:self]; |
2201 } | 2203 } |
2202 | 2204 |
2203 - (void)webControllerDidUpdateSSLStatusForCurrentNavigationItem: | 2205 - (void)webControllerDidUpdateSSLStatusForCurrentNavigationItem: |
2204 (CRWWebController*)webController { | 2206 (CRWWebController*)webController { |
2205 // Disable fullscreen if SSL cert is invalid. | 2207 // Disable fullscreen if SSL cert is invalid. |
2206 web::NavigationItem* item = [self navigationManager]->GetTransientItem(); | 2208 web::NavigationItem* item = [self navigationManager]->GetTransientItem(); |
2207 web::SecurityStyle securityStyle = | 2209 web::SecurityStyle securityStyle = |
2208 item ? item->GetSSL().security_style : web::SECURITY_STYLE_UNKNOWN; | 2210 item ? item->GetSSL().security_style : web::SECURITY_STYLE_UNKNOWN; |
2209 if (securityStyle == web::SECURITY_STYLE_AUTHENTICATION_BROKEN) { | 2211 if (securityStyle == web::SECURITY_STYLE_AUTHENTICATION_BROKEN) { |
2210 [fullScreenController_ disableFullScreen]; | 2212 [fullScreenController_ disableFullScreen]; |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2451 | 2453 |
2452 - (TabModel*)parentTabModel { | 2454 - (TabModel*)parentTabModel { |
2453 return parentTabModel_; | 2455 return parentTabModel_; |
2454 } | 2456 } |
2455 | 2457 |
2456 - (FormInputAccessoryViewController*)inputAccessoryViewController { | 2458 - (FormInputAccessoryViewController*)inputAccessoryViewController { |
2457 return inputAccessoryViewController_.get(); | 2459 return inputAccessoryViewController_.get(); |
2458 } | 2460 } |
2459 | 2461 |
2460 @end | 2462 @end |
OLD | NEW |