| 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/ui/browser_view_controller.h" | 5 #import "ios/chrome/browser/ui/browser_view_controller.h" |
| 6 | 6 |
| 7 #import <AssetsLibrary/AssetsLibrary.h> | 7 #import <AssetsLibrary/AssetsLibrary.h> |
| 8 #import <MobileCoreServices/MobileCoreServices.h> | 8 #import <MobileCoreServices/MobileCoreServices.h> |
| 9 #import <PassKit/PassKit.h> | 9 #import <PassKit/PassKit.h> |
| 10 #import <Photos/Photos.h> | 10 #import <Photos/Photos.h> |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 // Adds a CardView on top of the contentArea either taking the size of the full | 671 // Adds a CardView on top of the contentArea either taking the size of the full |
| 672 // screen or just the size of the space under the header. | 672 // screen or just the size of the space under the header. |
| 673 // Returns the CardView that was added. | 673 // Returns the CardView that was added. |
| 674 - (CardView*)addCardViewInFullscreen:(BOOL)fullScreen; | 674 - (CardView*)addCardViewInFullscreen:(BOOL)fullScreen; |
| 675 // Called when either a tab finishes loading or when a tab with finished content | 675 // Called when either a tab finishes loading or when a tab with finished content |
| 676 // is added directly to the model via pre-rendering. The tab must be non-nil and | 676 // is added directly to the model via pre-rendering. The tab must be non-nil and |
| 677 // must be a member of the tab model controlled by this BrowserViewController. | 677 // must be a member of the tab model controlled by this BrowserViewController. |
| 678 - (void)tabLoadComplete:(Tab*)tab withSuccess:(BOOL)success; | 678 - (void)tabLoadComplete:(Tab*)tab withSuccess:(BOOL)success; |
| 679 // Evaluates Javascript asynchronously using the current page context. | 679 // Evaluates Javascript asynchronously using the current page context. |
| 680 - (void)openJavascript:(NSString*)javascript; | 680 - (void)openJavascript:(NSString*)javascript; |
| 681 | |
| 682 // Sets the desktop user agent flag and reloads the current page. | |
| 683 - (void)enableDesktopUserAgent; | |
| 684 | |
| 685 // Sets the desktop user agent flag and reloads the current page. | |
| 686 - (void)enableMobileUserAgent; | |
| 687 | |
| 688 // Helper methods used by ShareToDelegate methods. | 681 // Helper methods used by ShareToDelegate methods. |
| 689 // Shows an alert with the given title and message id. | 682 // Shows an alert with the given title and message id. |
| 690 - (void)showErrorAlert:(int)titleMessageId message:(int)messageId; | 683 - (void)showErrorAlert:(int)titleMessageId message:(int)messageId; |
| 691 // Helper method displaying an alert with the given title and message. | 684 // Helper method displaying an alert with the given title and message. |
| 692 // Dismisses previous alert if it has not been dismissed yet. | 685 // Dismisses previous alert if it has not been dismissed yet. |
| 693 - (void)showErrorAlertWithStringTitle:(NSString*)title | 686 - (void)showErrorAlertWithStringTitle:(NSString*)title |
| 694 message:(NSString*)message; | 687 message:(NSString*)message; |
| 695 // Shows a self-dismissing snackbar displaying |message|. | 688 // Shows a self-dismissing snackbar displaying |message|. |
| 696 - (void)showSnackbar:(NSString*)message; | 689 - (void)showSnackbar:(NSString*)message; |
| 697 // Induces an intentional crash in the browser process. | 690 // Induces an intentional crash in the browser process. |
| (...skipping 3319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4017 case IDC_SHARE_PAGE: | 4010 case IDC_SHARE_PAGE: |
| 4018 [self sharePage]; | 4011 [self sharePage]; |
| 4019 break; | 4012 break; |
| 4020 case IDC_SHOW_MAIL_COMPOSER: | 4013 case IDC_SHOW_MAIL_COMPOSER: |
| 4021 [self showMailComposer:sender]; | 4014 [self showMailComposer:sender]; |
| 4022 break; | 4015 break; |
| 4023 case IDC_READER_MODE: | 4016 case IDC_READER_MODE: |
| 4024 [[_model currentTab] switchToReaderMode]; | 4017 [[_model currentTab] switchToReaderMode]; |
| 4025 break; | 4018 break; |
| 4026 case IDC_REQUEST_DESKTOP_SITE: | 4019 case IDC_REQUEST_DESKTOP_SITE: |
| 4027 [self enableDesktopUserAgent]; | 4020 [[_model currentTab] reloadWithUserAgentType:web::UserAgentType::DESKTOP]; |
| 4028 break; | 4021 break; |
| 4029 case IDC_REQUEST_MOBILE_SITE: | 4022 case IDC_REQUEST_MOBILE_SITE: |
| 4030 [self enableMobileUserAgent]; | 4023 [[_model currentTab] reloadWithUserAgentType:web::UserAgentType::MOBILE]; |
| 4031 break; | 4024 break; |
| 4032 case IDC_SHOW_TOOLS_MENU: { | 4025 case IDC_SHOW_TOOLS_MENU: { |
| 4033 [self showToolsMenuPopup]; | 4026 [self showToolsMenuPopup]; |
| 4034 break; | 4027 break; |
| 4035 } | 4028 } |
| 4036 case IDC_SHOW_BOOKMARK_MANAGER: { | 4029 case IDC_SHOW_BOOKMARK_MANAGER: { |
| 4037 if (IsIPadIdiom()) { | 4030 if (IsIPadIdiom()) { |
| 4038 [self showAllBookmarks]; | 4031 [self showAllBookmarks]; |
| 4039 } else { | 4032 } else { |
| 4040 [self initializeBookmarkInteractionController]; | 4033 [self initializeBookmarkInteractionController]; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4229 } | 4222 } |
| 4230 | 4223 |
| 4231 - (void)showHelpPage { | 4224 - (void)showHelpPage { |
| 4232 GURL helpUrl(l10n_util::GetStringUTF16(IDS_IOS_TOOLS_MENU_HELP_URL)); | 4225 GURL helpUrl(l10n_util::GetStringUTF16(IDS_IOS_TOOLS_MENU_HELP_URL)); |
| 4233 [self webPageOrderedOpen:helpUrl | 4226 [self webPageOrderedOpen:helpUrl |
| 4234 referrer:web::Referrer() | 4227 referrer:web::Referrer() |
| 4235 inBackground:NO | 4228 inBackground:NO |
| 4236 appendTo:kCurrentTab]; | 4229 appendTo:kCurrentTab]; |
| 4237 } | 4230 } |
| 4238 | 4231 |
| 4239 - (void)enableDesktopUserAgent { | |
| 4240 [[_model currentTab] reloadForDesktopUserAgent]; | |
| 4241 } | |
| 4242 | |
| 4243 // TODO(crbug.com/692303): Implement the actual functionality of | |
| 4244 // "Request Mobile Site", and also refactoring the user agent related function | |
| 4245 // names to improve readability. | |
| 4246 - (void)enableMobileUserAgent { | |
| 4247 } | |
| 4248 | |
| 4249 - (void)resetAllWebViews { | 4232 - (void)resetAllWebViews { |
| 4250 [_dialogPresenter cancelAllDialogs]; | 4233 [_dialogPresenter cancelAllDialogs]; |
| 4251 [_model resetAllWebViews]; | 4234 [_model resetAllWebViews]; |
| 4252 } | 4235 } |
| 4253 | 4236 |
| 4254 #pragma mark - Find Bar | 4237 #pragma mark - Find Bar |
| 4255 | 4238 |
| 4256 - (void)hideFindBarWithAnimation:(BOOL)animate { | 4239 - (void)hideFindBarWithAnimation:(BOOL)animate { |
| 4257 [_findBarController hideFindBarView:animate]; | 4240 [_findBarController hideFindBarView:animate]; |
| 4258 } | 4241 } |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5146 | 5129 |
| 5147 - (UIView*)voiceSearchButton { | 5130 - (UIView*)voiceSearchButton { |
| 5148 return _voiceSearchButton; | 5131 return _voiceSearchButton; |
| 5149 } | 5132 } |
| 5150 | 5133 |
| 5151 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5134 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
| 5152 return [self currentLogoAnimationControllerOwner]; | 5135 return [self currentLogoAnimationControllerOwner]; |
| 5153 } | 5136 } |
| 5154 | 5137 |
| 5155 @end | 5138 @end |
| OLD | NEW |