Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2789433006: Implement request mobile site. (Closed)
Patch Set: Fix failing eg tests on iPad. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/chrome/browser/ui/tools_menu/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 // Adds a CardView on top of the contentArea either taking the size of the full 717 // Adds a CardView on top of the contentArea either taking the size of the full
718 // screen or just the size of the space under the header. 718 // screen or just the size of the space under the header.
719 // Returns the CardView that was added. 719 // Returns the CardView that was added.
720 - (CardView*)addCardViewInFullscreen:(BOOL)fullScreen; 720 - (CardView*)addCardViewInFullscreen:(BOOL)fullScreen;
721 // Called when either a tab finishes loading or when a tab with finished content 721 // Called when either a tab finishes loading or when a tab with finished content
722 // is added directly to the model via pre-rendering. The tab must be non-nil and 722 // is added directly to the model via pre-rendering. The tab must be non-nil and
723 // must be a member of the tab model controlled by this BrowserViewController. 723 // must be a member of the tab model controlled by this BrowserViewController.
724 - (void)tabLoadComplete:(Tab*)tab withSuccess:(BOOL)success; 724 - (void)tabLoadComplete:(Tab*)tab withSuccess:(BOOL)success;
725 // Evaluates Javascript asynchronously using the current page context. 725 // Evaluates Javascript asynchronously using the current page context.
726 - (void)openJavascript:(NSString*)javascript; 726 - (void)openJavascript:(NSString*)javascript;
727
728 // Sets the desktop user agent flag and reloads the current page.
729 - (void)enableDesktopUserAgent;
730
731 // Sets the desktop user agent flag and reloads the current page.
732 - (void)enableMobileUserAgent;
733
734 // Helper methods used by ShareToDelegate methods. 727 // Helper methods used by ShareToDelegate methods.
735 // Shows an alert with the given title and message id. 728 // Shows an alert with the given title and message id.
736 - (void)showErrorAlert:(int)titleMessageId message:(int)messageId; 729 - (void)showErrorAlert:(int)titleMessageId message:(int)messageId;
737 // Helper method displaying an alert with the given title and message. 730 // Helper method displaying an alert with the given title and message.
738 // Dismisses previous alert if it has not been dismissed yet. 731 // Dismisses previous alert if it has not been dismissed yet.
739 - (void)showErrorAlertWithStringTitle:(NSString*)title 732 - (void)showErrorAlertWithStringTitle:(NSString*)title
740 message:(NSString*)message; 733 message:(NSString*)message;
741 // Shows a self-dismissing snackbar displaying |message|. 734 // Shows a self-dismissing snackbar displaying |message|.
742 - (void)showSnackbar:(NSString*)message; 735 - (void)showSnackbar:(NSString*)message;
743 // Induces an intentional crash in the browser process. 736 // Induces an intentional crash in the browser process.
(...skipping 3306 matching lines...) Expand 10 before | Expand all | Expand 10 after
4050 case IDC_SHARE_PAGE: 4043 case IDC_SHARE_PAGE:
4051 [self sharePage]; 4044 [self sharePage];
4052 break; 4045 break;
4053 case IDC_SHOW_MAIL_COMPOSER: 4046 case IDC_SHOW_MAIL_COMPOSER:
4054 [self showMailComposer:sender]; 4047 [self showMailComposer:sender];
4055 break; 4048 break;
4056 case IDC_READER_MODE: 4049 case IDC_READER_MODE:
4057 [[_model currentTab] switchToReaderMode]; 4050 [[_model currentTab] switchToReaderMode];
4058 break; 4051 break;
4059 case IDC_REQUEST_DESKTOP_SITE: 4052 case IDC_REQUEST_DESKTOP_SITE:
4060 [self enableDesktopUserAgent]; 4053 [[_model currentTab] reloadWithUserAgentType:web::UserAgentType::DESKTOP];
4061 break; 4054 break;
4062 case IDC_REQUEST_MOBILE_SITE: 4055 case IDC_REQUEST_MOBILE_SITE:
4063 [self enableMobileUserAgent]; 4056 [[_model currentTab] reloadWithUserAgentType:web::UserAgentType::MOBILE];
4064 break; 4057 break;
4065 case IDC_SHOW_TOOLS_MENU: { 4058 case IDC_SHOW_TOOLS_MENU: {
4066 [self showToolsMenuPopup]; 4059 [self showToolsMenuPopup];
4067 break; 4060 break;
4068 } 4061 }
4069 case IDC_SHOW_BOOKMARK_MANAGER: { 4062 case IDC_SHOW_BOOKMARK_MANAGER: {
4070 if (IsIPadIdiom()) { 4063 if (IsIPadIdiom()) {
4071 [self showAllBookmarks]; 4064 [self showAllBookmarks];
4072 } else { 4065 } else {
4073 [self initializeBookmarkInteractionController]; 4066 [self initializeBookmarkInteractionController];
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
4262 } 4255 }
4263 4256
4264 - (void)showHelpPage { 4257 - (void)showHelpPage {
4265 GURL helpUrl(l10n_util::GetStringUTF16(IDS_IOS_TOOLS_MENU_HELP_URL)); 4258 GURL helpUrl(l10n_util::GetStringUTF16(IDS_IOS_TOOLS_MENU_HELP_URL));
4266 [self webPageOrderedOpen:helpUrl 4259 [self webPageOrderedOpen:helpUrl
4267 referrer:web::Referrer() 4260 referrer:web::Referrer()
4268 inBackground:NO 4261 inBackground:NO
4269 appendTo:kCurrentTab]; 4262 appendTo:kCurrentTab];
4270 } 4263 }
4271 4264
4272 - (void)enableDesktopUserAgent {
4273 [[_model currentTab] reloadForDesktopUserAgent];
4274 }
4275
4276 // TODO(crbug.com/692303): Implement the actual functionality of
4277 // "Request Mobile Site", and also refactoring the user agent related function
4278 // names to improve readability.
4279 - (void)enableMobileUserAgent {
4280 }
4281
4282 - (void)resetAllWebViews { 4265 - (void)resetAllWebViews {
4283 [_dialogPresenter cancelAllDialogs]; 4266 [_dialogPresenter cancelAllDialogs];
4284 [_model resetAllWebViews]; 4267 [_model resetAllWebViews];
4285 } 4268 }
4286 4269
4287 #pragma mark - Find Bar 4270 #pragma mark - Find Bar
4288 4271
4289 - (void)hideFindBarWithAnimation:(BOOL)animate { 4272 - (void)hideFindBarWithAnimation:(BOOL)animate {
4290 [_findBarController hideFindBarView:animate]; 4273 [_findBarController hideFindBarView:animate];
4291 } 4274 }
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
5181 5164
5182 - (UIView*)voiceSearchButton { 5165 - (UIView*)voiceSearchButton {
5183 return _voiceSearchButton; 5166 return _voiceSearchButton;
5184 } 5167 }
5185 5168
5186 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5169 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5187 return [self currentLogoAnimationControllerOwner]; 5170 return [self currentLogoAnimationControllerOwner];
5188 } 5171 }
5189 5172
5190 @end 5173 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/chrome/browser/ui/tools_menu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698