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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 #include "ios/chrome/browser/search_engines/template_url_service_factory.h" | 70 #include "ios/chrome/browser/search_engines/template_url_service_factory.h" |
71 #include "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h" | 71 #include "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h" |
72 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.h" | 72 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.h" |
73 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios_fact ory.h" | 73 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios_fact ory.h" |
74 #import "ios/chrome/browser/snapshots/snapshot_cache.h" | 74 #import "ios/chrome/browser/snapshots/snapshot_cache.h" |
75 #import "ios/chrome/browser/snapshots/snapshot_overlay.h" | 75 #import "ios/chrome/browser/snapshots/snapshot_overlay.h" |
76 #import "ios/chrome/browser/snapshots/snapshot_overlay_provider.h" | 76 #import "ios/chrome/browser/snapshots/snapshot_overlay_provider.h" |
77 #import "ios/chrome/browser/storekit_launcher.h" | 77 #import "ios/chrome/browser/storekit_launcher.h" |
78 #import "ios/chrome/browser/tabs/tab.h" | 78 #import "ios/chrome/browser/tabs/tab.h" |
79 #import "ios/chrome/browser/tabs/tab_dialog_delegate.h" | 79 #import "ios/chrome/browser/tabs/tab_dialog_delegate.h" |
80 #import "ios/chrome/browser/tabs/tab_headers_delegate.h" | |
80 #import "ios/chrome/browser/tabs/tab_model.h" | 81 #import "ios/chrome/browser/tabs/tab_model.h" |
81 #import "ios/chrome/browser/tabs/tab_model_observer.h" | 82 #import "ios/chrome/browser/tabs/tab_model_observer.h" |
82 #import "ios/chrome/browser/tabs/tab_snapshotting_delegate.h" | 83 #import "ios/chrome/browser/tabs/tab_snapshotting_delegate.h" |
83 #import "ios/chrome/browser/ui/activity_services/share_protocol.h" | 84 #import "ios/chrome/browser/ui/activity_services/share_protocol.h" |
84 #import "ios/chrome/browser/ui/activity_services/share_to_data.h" | 85 #import "ios/chrome/browser/ui/activity_services/share_to_data.h" |
85 #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" | 86 #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" |
86 #import "ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.h" | 87 #import "ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.h" |
87 #import "ios/chrome/browser/ui/background_generator.h" | 88 #import "ios/chrome/browser/ui/background_generator.h" |
88 #import "ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.h" | 89 #import "ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.h" |
89 #import "ios/chrome/browser/ui/browser_container_view.h" | 90 #import "ios/chrome/browser/ui/browser_container_view.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
303 MFMailComposeViewControllerDelegate, | 304 MFMailComposeViewControllerDelegate, |
304 NewTabPageControllerObserver, | 305 NewTabPageControllerObserver, |
305 OverscrollActionsControllerDelegate, | 306 OverscrollActionsControllerDelegate, |
306 PassKitDialogProvider, | 307 PassKitDialogProvider, |
307 PreloadControllerDelegate, | 308 PreloadControllerDelegate, |
308 ShareToDelegate, | 309 ShareToDelegate, |
309 SKStoreProductViewControllerDelegate, | 310 SKStoreProductViewControllerDelegate, |
310 SnapshotOverlayProvider, | 311 SnapshotOverlayProvider, |
311 StoreKitLauncher, | 312 StoreKitLauncher, |
312 TabDialogDelegate, | 313 TabDialogDelegate, |
314 TabHeadersDelegate, | |
313 TabModelObserver, | 315 TabModelObserver, |
314 TabSnapshottingDelegate, | 316 TabSnapshottingDelegate, |
315 UIGestureRecognizerDelegate, | 317 UIGestureRecognizerDelegate, |
316 UpgradeCenterClientProtocol, | 318 UpgradeCenterClientProtocol, |
317 VoiceSearchBarDelegate, | 319 VoiceSearchBarDelegate, |
318 VoiceSearchBarOwner> { | 320 VoiceSearchBarOwner> { |
319 // The dependency factory passed on initialization. Used to vend objects used | 321 // The dependency factory passed on initialization. Used to vend objects used |
320 // by the BVC. | 322 // by the BVC. |
321 base::scoped_nsobject<BrowserViewControllerDependencyFactory> | 323 base::scoped_nsobject<BrowserViewControllerDependencyFactory> |
322 _dependencyFactory; | 324 _dependencyFactory; |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
729 // animation. | 731 // animation. |
730 - (id<LogoAnimationControllerOwner>)currentLogoAnimationControllerOwner; | 732 - (id<LogoAnimationControllerOwner>)currentLogoAnimationControllerOwner; |
731 // Returns the header views, all the chrome on top of the page, including the | 733 // Returns the header views, all the chrome on top of the page, including the |
732 // ones that cannot be scrolled off screen by full screen. | 734 // ones that cannot be scrolled off screen by full screen. |
733 - (const std::vector<HeaderDefinition>)headerViews; | 735 - (const std::vector<HeaderDefinition>)headerViews; |
734 // Returns the footer view if one exists (e.g. the voice search bar). | 736 // Returns the footer view if one exists (e.g. the voice search bar). |
735 - (UIView*)footerView; | 737 - (UIView*)footerView; |
736 // Returns the height of the header view for the tab model's current tab. | 738 // Returns the height of the header view for the tab model's current tab. |
737 - (CGFloat)headerHeight; | 739 - (CGFloat)headerHeight; |
738 // Returns the height of the header view for |tab|. | 740 // Returns the height of the header view for |tab|. |
739 - (CGFloat)headerHeightForTab:(Tab*)tab; | 741 - (CGFloat)headerHeightForTab:(Tab*)tab; |
rohitrao (ping after 24h)
2017/01/10 17:15:25
This can be removed from the forward-declaration l
Olivier
2017/01/10 18:27:09
Done.
| |
740 // Sets the frame for the headers. | 742 // Sets the frame for the headers. |
741 - (void)setFramesForHeaders:(const std::vector<HeaderDefinition>)headers | 743 - (void)setFramesForHeaders:(const std::vector<HeaderDefinition>)headers |
742 atOffset:(CGFloat)headerOffset; | 744 atOffset:(CGFloat)headerOffset; |
743 // Returns the y coordinate for the footer's frame when animating the footer | 745 // Returns the y coordinate for the footer's frame when animating the footer |
744 // in/out of fullscreen. | 746 // in/out of fullscreen. |
745 - (CGFloat)footerYForHeaderOffset:(CGFloat)headerOffset; | 747 - (CGFloat)footerYForHeaderOffset:(CGFloat)headerOffset; |
746 // Called when the animation for setting the header view's offset is finished. | 748 // Called when the animation for setting the header view's offset is finished. |
747 // |completed| should indicate if the animation finished completely or was | 749 // |completed| should indicate if the animation finished completely or was |
748 // interrupted. |offset| should indicate the header offset after the animation. | 750 // interrupted. |offset| should indicate the header offset after the animation. |
749 // |dragged| should indicate if the header moved due to the user dragging. | 751 // |dragged| should indicate if the header moved due to the user dragging. |
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2101 // TODO(crbug.com/375577): Unregister these delegates correctly on BVC | 2103 // TODO(crbug.com/375577): Unregister these delegates correctly on BVC |
2102 // deallocation. | 2104 // deallocation. |
2103 tab.dialogDelegate = self; | 2105 tab.dialogDelegate = self; |
2104 tab.snapshotOverlayProvider = self; | 2106 tab.snapshotOverlayProvider = self; |
2105 tab.storeKitLauncher = self; | 2107 tab.storeKitLauncher = self; |
2106 tab.passKitDialogProvider = self; | 2108 tab.passKitDialogProvider = self; |
2107 tab.fullScreenControllerDelegate = self; | 2109 tab.fullScreenControllerDelegate = self; |
2108 if (!IsIPadIdiom()) { | 2110 if (!IsIPadIdiom()) { |
2109 tab.overscrollActionsControllerDelegate = self; | 2111 tab.overscrollActionsControllerDelegate = self; |
2110 } | 2112 } |
2113 tab.tabHeadersDelegate = self; | |
2111 tab.tabSnapshottingDelegate = self; | 2114 tab.tabSnapshottingDelegate = self; |
2112 // Install the proper CRWWebController delegates. | 2115 // Install the proper CRWWebController delegates. |
2113 tab.webController.nativeProvider = self; | 2116 tab.webController.nativeProvider = self; |
2114 tab.webController.swipeRecognizerProvider = self.sideSwipeController; | 2117 tab.webController.swipeRecognizerProvider = self.sideSwipeController; |
2115 // Delegate will remove itself on destruction. | 2118 // Delegate will remove itself on destruction. |
2116 tab.webState->SetDelegate(_webStateDelegate.get()); | 2119 tab.webState->SetDelegate(_webStateDelegate.get()); |
2117 } | 2120 } |
2118 | 2121 |
2119 // Called when a tab is selected in the model. Make any required view changes. | 2122 // Called when a tab is selected in the model. Make any required view changes. |
2120 // The notification will not be sent when the tab is already the selected tab. | 2123 // The notification will not be sent when the tab is already the selected tab. |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2577 results.push_back(header); | 2580 results.push_back(header); |
2578 } | 2581 } |
2579 } | 2582 } |
2580 return results; | 2583 return results; |
2581 } | 2584 } |
2582 | 2585 |
2583 - (UIView*)footerView { | 2586 - (UIView*)footerView { |
2584 return _voiceSearchBar; | 2587 return _voiceSearchBar; |
2585 } | 2588 } |
2586 | 2589 |
2587 - (CGFloat)headerHeight { | 2590 - (CGFloat)headerHeight { |
rohitrao (ping after 24h)
2017/01/10 17:15:25
Does anyone still call this method? Should we ren
Olivier
2017/01/10 18:27:09
Yes, it is still in SideSwipeController and FullSc
| |
2588 return [self headerHeightForTab:[_model currentTab]]; | 2591 return [self headerHeightForTab:[_model currentTab]]; |
2589 } | 2592 } |
2590 | 2593 |
2591 - (CGFloat)headerHeightForTab:(Tab*)tab { | 2594 - (CGFloat)headerHeightForTab:(Tab*)tab { |
2592 id nativeController = [self nativeControllerForTab:tab]; | 2595 id nativeController = [self nativeControllerForTab:tab]; |
2593 if ([nativeController conformsToProtocol:@protocol(ToolbarOwner)] && | 2596 if ([nativeController conformsToProtocol:@protocol(ToolbarOwner)] && |
2594 [nativeController respondsToSelector:@selector(toolbarHeight)] && | 2597 [nativeController respondsToSelector:@selector(toolbarHeight)] && |
2595 [nativeController toolbarHeight] > 0.0 && !IsIPadIdiom()) { | 2598 [nativeController toolbarHeight] > 0.0 && !IsIPadIdiom()) { |
2596 // On iPhone, don't add any header height for ToolbarOwner native | 2599 // On iPhone, don't add any header height for ToolbarOwner native |
2597 // controllers when they're displaying their own toolbar. | 2600 // controllers when they're displaying their own toolbar. |
(...skipping 2498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5096 | 5099 |
5097 - (UIView*)voiceSearchButton { | 5100 - (UIView*)voiceSearchButton { |
5098 return _voiceSearchButton; | 5101 return _voiceSearchButton; |
5099 } | 5102 } |
5100 | 5103 |
5101 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5104 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
5102 return [self currentLogoAnimationControllerOwner]; | 5105 return [self currentLogoAnimationControllerOwner]; |
5103 } | 5106 } |
5104 | 5107 |
5105 @end | 5108 @end |
OLD | NEW |