| 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 2734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2745 | 2745 |
| 2746 #pragma mark - Install OverScrollActionController method. | 2746 #pragma mark - Install OverScrollActionController method. |
| 2747 - (void)setOverScrollActionControllerToStaticNativeContent: | 2747 - (void)setOverScrollActionControllerToStaticNativeContent: |
| 2748 (StaticHtmlNativeContent*)nativeContent { | 2748 (StaticHtmlNativeContent*)nativeContent { |
| 2749 if (!IsIPadIdiom() && !FirstRun::IsChromeFirstRun()) { | 2749 if (!IsIPadIdiom() && !FirstRun::IsChromeFirstRun()) { |
| 2750 OverscrollActionsController* controller = | 2750 OverscrollActionsController* controller = |
| 2751 [[[OverscrollActionsController alloc] | 2751 [[[OverscrollActionsController alloc] |
| 2752 initWithScrollView:[nativeContent scrollView]] autorelease]; | 2752 initWithScrollView:[nativeContent scrollView]] autorelease]; |
| 2753 [[nativeContent scrollView] setDelegate:controller]; | 2753 [[nativeContent scrollView] setDelegate:controller]; |
| 2754 [controller setDelegate:self]; | 2754 [controller setDelegate:self]; |
| 2755 ios_internal::OverscrollStyle style = | 2755 OverscrollStyle style = _isOffTheRecord |
| 2756 _isOffTheRecord | 2756 ? OverscrollStyle::REGULAR_PAGE_INCOGNITO |
| 2757 ? ios_internal::OverscrollStyle::REGULAR_PAGE_INCOGNITO | 2757 : OverscrollStyle::REGULAR_PAGE_NON_INCOGNITO; |
| 2758 : ios_internal::OverscrollStyle::REGULAR_PAGE_NON_INCOGNITO; | |
| 2759 controller.style = style; | 2758 controller.style = style; |
| 2760 nativeContent.overscrollActionsController = controller; | 2759 nativeContent.overscrollActionsController = controller; |
| 2761 } | 2760 } |
| 2762 } | 2761 } |
| 2763 | 2762 |
| 2764 #pragma mark - OverscrollActionsControllerDelegate methods. | 2763 #pragma mark - OverscrollActionsControllerDelegate methods. |
| 2765 | 2764 |
| 2766 - (void)overscrollActionsController:(OverscrollActionsController*)controller | 2765 - (void)overscrollActionsController:(OverscrollActionsController*)controller |
| 2767 didTriggerAction:(ios_internal::OverscrollAction)action { | 2766 didTriggerAction:(OverscrollAction)action { |
| 2768 switch (action) { | 2767 switch (action) { |
| 2769 case ios_internal::OverscrollAction::NEW_TAB: | 2768 case OverscrollAction::NEW_TAB: |
| 2770 [self newTab:nil]; | 2769 [self newTab:nil]; |
| 2771 break; | 2770 break; |
| 2772 case ios_internal::OverscrollAction::CLOSE_TAB: | 2771 case OverscrollAction::CLOSE_TAB: |
| 2773 [self closeCurrentTab]; | 2772 [self closeCurrentTab]; |
| 2774 break; | 2773 break; |
| 2775 case ios_internal::OverscrollAction::REFRESH: | 2774 case OverscrollAction::REFRESH: |
| 2776 if ([[[_model currentTab] webController] loadPhase] == | 2775 if ([[[_model currentTab] webController] loadPhase] == |
| 2777 web::PAGE_LOADING) { | 2776 web::PAGE_LOADING) { |
| 2778 [[_model currentTab] stopLoading]; | 2777 [[_model currentTab] stopLoading]; |
| 2779 } | 2778 } |
| 2780 [[_model currentTab] reload]; | 2779 [[_model currentTab] reload]; |
| 2781 break; | 2780 break; |
| 2782 case ios_internal::OverscrollAction::NONE: | 2781 case OverscrollAction::NONE: |
| 2783 NOTREACHED(); | 2782 NOTREACHED(); |
| 2784 break; | 2783 break; |
| 2785 } | 2784 } |
| 2786 } | 2785 } |
| 2787 | 2786 |
| 2788 - (BOOL)shouldAllowOverscrollActions { | 2787 - (BOOL)shouldAllowOverscrollActions { |
| 2789 return YES; | 2788 return YES; |
| 2790 } | 2789 } |
| 2791 | 2790 |
| 2792 - (UIView*)headerView { | 2791 - (UIView*)headerView { |
| (...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5098 | 5097 |
| 5099 - (UIView*)voiceSearchButton { | 5098 - (UIView*)voiceSearchButton { |
| 5100 return _voiceSearchButton; | 5099 return _voiceSearchButton; |
| 5101 } | 5100 } |
| 5102 | 5101 |
| 5103 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5102 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
| 5104 return [self currentLogoAnimationControllerOwner]; | 5103 return [self currentLogoAnimationControllerOwner]; |
| 5105 } | 5104 } |
| 5106 | 5105 |
| 5107 @end | 5106 @end |
| OLD | NEW |