| 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 2867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2878 | 2878 |
| 2879 - (void)overscrollActionsController:(OverscrollActionsController*)controller | 2879 - (void)overscrollActionsController:(OverscrollActionsController*)controller |
| 2880 didTriggerAction:(OverscrollAction)action { | 2880 didTriggerAction:(OverscrollAction)action { |
| 2881 switch (action) { | 2881 switch (action) { |
| 2882 case OverscrollAction::NEW_TAB: | 2882 case OverscrollAction::NEW_TAB: |
| 2883 [self newTab:nil]; | 2883 [self newTab:nil]; |
| 2884 break; | 2884 break; |
| 2885 case OverscrollAction::CLOSE_TAB: | 2885 case OverscrollAction::CLOSE_TAB: |
| 2886 [self closeCurrentTab]; | 2886 [self closeCurrentTab]; |
| 2887 break; | 2887 break; |
| 2888 case OverscrollAction::REFRESH: | 2888 case OverscrollAction::REFRESH: { |
| 2889 if ([[[_model currentTab] webController] loadPhase] == | 2889 if ([[[_model currentTab] webController] loadPhase] == |
| 2890 web::PAGE_LOADING) { | 2890 web::PAGE_LOADING) { |
| 2891 [[_model currentTab] stopLoading]; | 2891 [[_model currentTab] stopLoading]; |
| 2892 } | 2892 } |
| 2893 [[_model currentTab] reload]; | 2893 |
| 2894 web::WebState* webState = [_model currentTab].webState; |
| 2895 if (webState) |
| 2896 // |check_for_repost| is true because the reload is explicitly initiated |
| 2897 // by the user. |
| 2898 webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL, |
| 2899 true /* check_for_repost */); |
| 2894 break; | 2900 break; |
| 2901 } |
| 2895 case OverscrollAction::NONE: | 2902 case OverscrollAction::NONE: |
| 2896 NOTREACHED(); | 2903 NOTREACHED(); |
| 2897 break; | 2904 break; |
| 2898 } | 2905 } |
| 2899 } | 2906 } |
| 2900 | 2907 |
| 2901 - (BOOL)shouldAllowOverscrollActions { | 2908 - (BOOL)shouldAllowOverscrollActions { |
| 2902 return YES; | 2909 return YES; |
| 2903 } | 2910 } |
| 2904 | 2911 |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3835 return; | 3842 return; |
| 3836 [_typingShield setHidden:YES]; | 3843 [_typingShield setHidden:YES]; |
| 3837 }]; | 3844 }]; |
| 3838 [[OmniboxGeolocationController sharedInstance] | 3845 [[OmniboxGeolocationController sharedInstance] |
| 3839 locationBarDidResignFirstResponder:_browserState]; | 3846 locationBarDidResignFirstResponder:_browserState]; |
| 3840 | 3847 |
| 3841 // If a load was cancelled by an omnibox edit, but nothing is loading when | 3848 // If a load was cancelled by an omnibox edit, but nothing is loading when |
| 3842 // editing ends (i.e., editing was cancelled), restart the cancelled load. | 3849 // editing ends (i.e., editing was cancelled), restart the cancelled load. |
| 3843 if (_locationBarEditCancelledLoad) { | 3850 if (_locationBarEditCancelledLoad) { |
| 3844 _locationBarEditCancelledLoad = NO; | 3851 _locationBarEditCancelledLoad = NO; |
| 3845 if (!_toolbarModelIOS->IsLoading()) { | 3852 |
| 3846 [[_model currentTab] reload]; | 3853 web::WebState* webState = [_model currentTab].webState; |
| 3847 } | 3854 if (!_toolbarModelIOS->IsLoading() && webState) |
| 3855 webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL, |
| 3856 false /* check_for_repost */); |
| 3848 } | 3857 } |
| 3849 } | 3858 } |
| 3850 | 3859 |
| 3851 - (IBAction)locationBarBeganEdit:(id)sender { | 3860 - (IBAction)locationBarBeganEdit:(id)sender { |
| 3852 // On handsets, if a page is currently loading it should be stopped. | 3861 // On handsets, if a page is currently loading it should be stopped. |
| 3853 if (!IsIPadIdiom() && _toolbarModelIOS->IsLoading()) { | 3862 if (!IsIPadIdiom() && _toolbarModelIOS->IsLoading()) { |
| 3854 base::scoped_nsobject<GenericChromeCommand> command( | 3863 base::scoped_nsobject<GenericChromeCommand> command( |
| 3855 [[GenericChromeCommand alloc] initWithTag:IDC_STOP]); | 3864 [[GenericChromeCommand alloc] initWithTag:IDC_STOP]); |
| 3856 [self chromeExecuteCommand:command]; | 3865 [self chromeExecuteCommand:command]; |
| 3857 _locationBarEditCancelledLoad = YES; | 3866 _locationBarEditCancelledLoad = YES; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3979 _voiceSearchController->PrepareToAppear(); | 3988 _voiceSearchController->PrepareToAppear(); |
| 3980 break; | 3989 break; |
| 3981 case IDC_NEW_INCOGNITO_TAB: | 3990 case IDC_NEW_INCOGNITO_TAB: |
| 3982 if (_isOffTheRecord) { | 3991 if (_isOffTheRecord) { |
| 3983 [self newTab:sender]; | 3992 [self newTab:sender]; |
| 3984 } else { | 3993 } else { |
| 3985 // Not for this browser state, send it on its way. | 3994 // Not for this browser state, send it on its way. |
| 3986 [super chromeExecuteCommand:sender]; | 3995 [super chromeExecuteCommand:sender]; |
| 3987 } | 3996 } |
| 3988 break; | 3997 break; |
| 3989 case IDC_RELOAD: | 3998 case IDC_RELOAD: { |
| 3990 [[_model currentTab] reload]; | 3999 web::WebState* webState = [_model currentTab].webState; |
| 4000 if (webState) |
| 4001 // |check_for_repost| is true because the reload is explicitly initiated |
| 4002 // by the user. |
| 4003 webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL, |
| 4004 true /* check_for_repost */); |
| 3991 break; | 4005 break; |
| 4006 } |
| 3992 case IDC_SHARE_PAGE: | 4007 case IDC_SHARE_PAGE: |
| 3993 [self sharePage]; | 4008 [self sharePage]; |
| 3994 break; | 4009 break; |
| 3995 case IDC_SHOW_MAIL_COMPOSER: | 4010 case IDC_SHOW_MAIL_COMPOSER: |
| 3996 [self showMailComposer:sender]; | 4011 [self showMailComposer:sender]; |
| 3997 break; | 4012 break; |
| 3998 case IDC_READER_MODE: | 4013 case IDC_READER_MODE: |
| 3999 [[_model currentTab] switchToReaderMode]; | 4014 [[_model currentTab] switchToReaderMode]; |
| 4000 break; | 4015 break; |
| 4001 case IDC_REQUEST_DESKTOP_SITE: | 4016 case IDC_REQUEST_DESKTOP_SITE: |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5101 | 5116 |
| 5102 - (UIView*)voiceSearchButton { | 5117 - (UIView*)voiceSearchButton { |
| 5103 return _voiceSearchButton; | 5118 return _voiceSearchButton; |
| 5104 } | 5119 } |
| 5105 | 5120 |
| 5106 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5121 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
| 5107 return [self currentLogoAnimationControllerOwner]; | 5122 return [self currentLogoAnimationControllerOwner]; |
| 5108 } | 5123 } |
| 5109 | 5124 |
| 5110 @end | 5125 @end |
| OLD | NEW |