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

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

Issue 2965963002: [ios] Remove IDC_STOP and IDC_RELOAD
Patch Set: Rebased. Created 3 years, 5 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 | « no previous file | ios/chrome/browser/ui/commands/browser_commands.h » ('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 3514 matching lines...) Expand 10 before | Expand all | Expand 10 after
3525 PageInfoModelBubbleBridge* bridge = new PageInfoModelBubbleBridge(); 3525 PageInfoModelBubbleBridge* bridge = new PageInfoModelBubbleBridge();
3526 PageInfoModel* pageInfoModel = new PageInfoModel( 3526 PageInfoModel* pageInfoModel = new PageInfoModel(
3527 _browserState, navItem->GetURL(), navItem->GetSSL(), bridge); 3527 _browserState, navItem->GetURL(), navItem->GetSSL(), bridge);
3528 3528
3529 UIView* view = [self view]; 3529 UIView* view = [self view];
3530 _pageInfoController = [[PageInfoViewController alloc] 3530 _pageInfoController = [[PageInfoViewController alloc]
3531 initWithModel:pageInfoModel 3531 initWithModel:pageInfoModel
3532 bridge:bridge 3532 bridge:bridge
3533 sourceFrame:[sourceView convertRect:[sourceView bounds] toView:view] 3533 sourceFrame:[sourceView convertRect:[sourceView bounds] toView:view]
3534 parentView:view]; 3534 parentView:view];
3535 _pageInfoController.dispatcher = self.browserCommandDispatcher;
3535 bridge->set_controller(_pageInfoController); 3536 bridge->set_controller(_pageInfoController);
3536 } 3537 }
3537 3538
3538 - (void)hidePageInfoPopupForView:(UIView*)sourceView { 3539 - (void)hidePageInfoPopupForView:(UIView*)sourceView {
3539 [_pageInfoController dismiss]; 3540 [_pageInfoController dismiss];
3540 _pageInfoController = nil; 3541 _pageInfoController = nil;
3541 } 3542 }
3542 3543
3543 - (void)showSecurityHelpPage { 3544 - (void)showSecurityHelpPage {
3544 [self webPageOrderedOpen:GURL(kPageInfoHelpCenterURL) 3545 [self webPageOrderedOpen:GURL(kPageInfoHelpCenterURL)
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
3962 web::WebState* webState = [_model currentTab].webState; 3963 web::WebState* webState = [_model currentTab].webState;
3963 if (!_toolbarModelIOS->IsLoading() && webState) 3964 if (!_toolbarModelIOS->IsLoading() && webState)
3964 webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL, 3965 webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
3965 false /* check_for_repost */); 3966 false /* check_for_repost */);
3966 } 3967 }
3967 } 3968 }
3968 3969
3969 - (IBAction)locationBarBeganEdit:(id)sender { 3970 - (IBAction)locationBarBeganEdit:(id)sender {
3970 // On handsets, if a page is currently loading it should be stopped. 3971 // On handsets, if a page is currently loading it should be stopped.
3971 if (!IsIPadIdiom() && _toolbarModelIOS->IsLoading()) { 3972 if (!IsIPadIdiom() && _toolbarModelIOS->IsLoading()) {
3972 GenericChromeCommand* command = 3973 [self.browserCommandDispatcher stopLoading];
3973 [[GenericChromeCommand alloc] initWithTag:IDC_STOP];
3974 [self chromeExecuteCommand:command];
3975 _locationBarEditCancelledLoad = YES; 3974 _locationBarEditCancelledLoad = YES;
3976 } 3975 }
3977 } 3976 }
3978 3977
3979 - (IBAction)prepareToEnterTabSwitcher:(id)sender { 3978 - (IBAction)prepareToEnterTabSwitcher:(id)sender {
3980 [[_model currentTab] updateSnapshotWithOverlay:YES visibleFrameOnly:YES]; 3979 [[_model currentTab] updateSnapshotWithOverlay:YES visibleFrameOnly:YES];
3981 } 3980 }
3982 3981
3983 - (ToolbarModelIOS*)toolbarModelIOS { 3982 - (ToolbarModelIOS*)toolbarModelIOS {
3984 return _toolbarModelIOS.get(); 3983 return _toolbarModelIOS.get();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
4023 #pragma mark - BrowserCommands 4022 #pragma mark - BrowserCommands
4024 4023
4025 - (void)goBack { 4024 - (void)goBack {
4026 [[_model currentTab] goBack]; 4025 [[_model currentTab] goBack];
4027 } 4026 }
4028 4027
4029 - (void)goForward { 4028 - (void)goForward {
4030 [[_model currentTab] goForward]; 4029 [[_model currentTab] goForward];
4031 } 4030 }
4032 4031
4032 - (void)stopLoading {
4033 [_model currentTab].webState->Stop();
4034 }
4035
4036 - (void)reload {
4037 web::WebState* webState = [_model currentTab].webState;
4038 if (webState) {
4039 // |check_for_repost| is true because the reload is explicitly initiated
4040 // by the user.
4041 webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
4042 true /* check_for_repost */);
4043 }
4044 }
4045
4033 #pragma mark - Command Handling 4046 #pragma mark - Command Handling
4034 4047
4035 - (IBAction)chromeExecuteCommand:(id)sender { 4048 - (IBAction)chromeExecuteCommand:(id)sender {
4036 NSInteger command = [sender tag]; 4049 NSInteger command = [sender tag];
4037 4050
4038 if (!_model || !_browserState) 4051 if (!_model || !_browserState)
4039 return; 4052 return;
4040 Tab* currentTab = [_model currentTab]; 4053 Tab* currentTab = [_model currentTab];
4041 4054
4042 switch (command) { 4055 switch (command) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
4097 break; 4110 break;
4098 case IDC_NEW_INCOGNITO_TAB: 4111 case IDC_NEW_INCOGNITO_TAB:
4099 if (_isOffTheRecord) { 4112 if (_isOffTheRecord) {
4100 [self newTab:sender]; 4113 [self newTab:sender];
4101 } else { 4114 } else {
4102 // Not for this browser state, send it on its way. 4115 // Not for this browser state, send it on its way.
4103 [super chromeExecuteCommand:sender]; 4116 [super chromeExecuteCommand:sender];
4104 } 4117 }
4105 break; 4118 break;
4106 case IDC_RELOAD: { 4119 case IDC_RELOAD: {
4107 web::WebState* webState = [_model currentTab].webState; 4120 // Route to dispatcher until downstream code is migrated.
4108 if (webState) 4121 [self.browserCommandDispatcher reload];
4109 // |check_for_repost| is true because the reload is explicitly initiated
4110 // by the user.
4111 webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
4112 true /* check_for_repost */);
4113 break; 4122 break;
4114 } 4123 }
4115 case IDC_SHARE_PAGE: 4124 case IDC_SHARE_PAGE:
4116 [self sharePage]; 4125 [self sharePage];
4117 break; 4126 break;
4118 case IDC_SHOW_MAIL_COMPOSER: 4127 case IDC_SHOW_MAIL_COMPOSER:
4119 [self showMailComposer:sender]; 4128 [self showMailComposer:sender];
4120 break; 4129 break;
4121 case IDC_READER_MODE: 4130 case IDC_READER_MODE:
4122 [[_model currentTab] switchToReaderMode]; 4131 [[_model currentTab] switchToReaderMode];
(...skipping 23 matching lines...) Expand all
4146 } else { 4155 } else {
4147 UIViewController* controller = [RecentTabsPanelViewController 4156 UIViewController* controller = [RecentTabsPanelViewController
4148 controllerToPresentForBrowserState:_browserState 4157 controllerToPresentForBrowserState:_browserState
4149 loader:self]; 4158 loader:self];
4150 controller.modalPresentationStyle = UIModalPresentationFormSheet; 4159 controller.modalPresentationStyle = UIModalPresentationFormSheet;
4151 controller.modalPresentationCapturesStatusBarAppearance = YES; 4160 controller.modalPresentationCapturesStatusBarAppearance = YES;
4152 [self presentViewController:controller animated:YES completion:nil]; 4161 [self presentViewController:controller animated:YES completion:nil];
4153 } 4162 }
4154 break; 4163 break;
4155 } 4164 }
4156 case IDC_STOP:
4157 [_model currentTab].webState->Stop();
4158 break;
4159 #if !defined(NDEBUG) 4165 #if !defined(NDEBUG)
4160 case IDC_VIEW_SOURCE: 4166 case IDC_VIEW_SOURCE:
4161 [self viewSource]; 4167 [self viewSource];
4162 break; 4168 break;
4163 #endif 4169 #endif
4164 case IDC_SHOW_PAGE_INFO: 4170 case IDC_SHOW_PAGE_INFO:
4165 DCHECK([sender isKindOfClass:[UIButton class]]); 4171 DCHECK([sender isKindOfClass:[UIButton class]]);
4166 [self showPageInfoPopupForView:sender]; 4172 [self showPageInfoPopupForView:sender];
4167 break; 4173 break;
4168 case IDC_HIDE_PAGE_INFO: 4174 case IDC_HIDE_PAGE_INFO:
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
5239 5245
5240 - (UIView*)voiceSearchButton { 5246 - (UIView*)voiceSearchButton {
5241 return _voiceSearchButton; 5247 return _voiceSearchButton;
5242 } 5248 }
5243 5249
5244 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5250 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5245 return [self currentLogoAnimationControllerOwner]; 5251 return [self currentLogoAnimationControllerOwner];
5246 } 5252 }
5247 5253
5248 @end 5254 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/ui/commands/browser_commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698