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

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

Issue 2731553005: Introduced StoreKitTabHelper class (Closed)
Patch Set: rebase Created 3 years, 9 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
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "ios/chrome/browser/pref_names.h" 73 #include "ios/chrome/browser/pref_names.h"
74 #include "ios/chrome/browser/reading_list/offline_url_utils.h" 74 #include "ios/chrome/browser/reading_list/offline_url_utils.h"
75 #include "ios/chrome/browser/reading_list/reading_list_model_factory.h" 75 #include "ios/chrome/browser/reading_list/reading_list_model_factory.h"
76 #include "ios/chrome/browser/search_engines/template_url_service_factory.h" 76 #include "ios/chrome/browser/search_engines/template_url_service_factory.h"
77 #include "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h" 77 #include "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h"
78 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.h" 78 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.h"
79 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios_fact ory.h" 79 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios_fact ory.h"
80 #import "ios/chrome/browser/snapshots/snapshot_cache.h" 80 #import "ios/chrome/browser/snapshots/snapshot_cache.h"
81 #import "ios/chrome/browser/snapshots/snapshot_overlay.h" 81 #import "ios/chrome/browser/snapshots/snapshot_overlay.h"
82 #import "ios/chrome/browser/snapshots/snapshot_overlay_provider.h" 82 #import "ios/chrome/browser/snapshots/snapshot_overlay_provider.h"
83 #import "ios/chrome/browser/storekit_launcher.h" 83 #import "ios/chrome/browser/store_kit/store_kit_tab_helper.h"
84 #import "ios/chrome/browser/tabs/legacy_tab_helper.h" 84 #import "ios/chrome/browser/tabs/legacy_tab_helper.h"
85 #import "ios/chrome/browser/tabs/tab.h" 85 #import "ios/chrome/browser/tabs/tab.h"
86 #import "ios/chrome/browser/tabs/tab_dialog_delegate.h" 86 #import "ios/chrome/browser/tabs/tab_dialog_delegate.h"
87 #import "ios/chrome/browser/tabs/tab_headers_delegate.h" 87 #import "ios/chrome/browser/tabs/tab_headers_delegate.h"
88 #import "ios/chrome/browser/tabs/tab_model.h" 88 #import "ios/chrome/browser/tabs/tab_model.h"
89 #import "ios/chrome/browser/tabs/tab_model_observer.h" 89 #import "ios/chrome/browser/tabs/tab_model_observer.h"
90 #import "ios/chrome/browser/tabs/tab_snapshotting_delegate.h" 90 #import "ios/chrome/browser/tabs/tab_snapshotting_delegate.h"
91 #import "ios/chrome/browser/ui/activity_services/chrome_activity_item_thumbnail_ generator.h" 91 #import "ios/chrome/browser/ui/activity_services/chrome_activity_item_thumbnail_ generator.h"
92 #import "ios/chrome/browser/ui/activity_services/share_protocol.h" 92 #import "ios/chrome/browser/ui/activity_services/share_protocol.h"
93 #import "ios/chrome/browser/ui/activity_services/share_to_data.h" 93 #import "ios/chrome/browser/ui/activity_services/share_to_data.h"
(...skipping 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 pageView.backgroundColor = [UIColor whiteColor]; 2088 pageView.backgroundColor = [UIColor whiteColor];
2089 return pageView; 2089 return pageView;
2090 } 2090 }
2091 2091
2092 - (void)installDelegatesForTab:(Tab*)tab { 2092 - (void)installDelegatesForTab:(Tab*)tab {
2093 // We don't unregister any of this delegation. 2093 // We don't unregister any of this delegation.
2094 // TODO(crbug.com/375577): Unregister these delegates correctly on BVC 2094 // TODO(crbug.com/375577): Unregister these delegates correctly on BVC
2095 // deallocation. 2095 // deallocation.
2096 tab.dialogDelegate = self; 2096 tab.dialogDelegate = self;
2097 tab.snapshotOverlayProvider = self; 2097 tab.snapshotOverlayProvider = self;
2098 tab.storeKitLauncher = self;
2099 tab.passKitDialogProvider = self; 2098 tab.passKitDialogProvider = self;
2100 tab.fullScreenControllerDelegate = self; 2099 tab.fullScreenControllerDelegate = self;
2101 if (!IsIPadIdiom()) { 2100 if (!IsIPadIdiom()) {
2102 tab.overscrollActionsControllerDelegate = self; 2101 tab.overscrollActionsControllerDelegate = self;
2103 } 2102 }
2104 tab.tabHeadersDelegate = self; 2103 tab.tabHeadersDelegate = self;
2105 tab.tabSnapshottingDelegate = self; 2104 tab.tabSnapshottingDelegate = self;
2106 // Install the proper CRWWebController delegates. 2105 // Install the proper CRWWebController delegates.
2107 tab.webController.nativeProvider = self; 2106 tab.webController.nativeProvider = self;
2108 tab.webController.swipeRecognizerProvider = self.sideSwipeController; 2107 tab.webController.swipeRecognizerProvider = self.sideSwipeController;
2108 // BrowserViewController presents SKStoreKitViewController on behalf of a
2109 // tab.
2110 StoreKitTabHelper* tabHelper = StoreKitTabHelper::FromWebState(tab.webState);
2111 if (tabHelper)
2112 tabHelper->SetLauncher(self);
2109 // Delegate will remove itself on destruction. 2113 // Delegate will remove itself on destruction.
2110 tab.webState->SetDelegate(_webStateDelegate.get()); 2114 tab.webState->SetDelegate(_webStateDelegate.get());
2111 } 2115 }
2112 2116
2113 // Called when a tab is selected in the model. Make any required view changes. 2117 // Called when a tab is selected in the model. Make any required view changes.
2114 // The notification will not be sent when the tab is already the selected tab. 2118 // The notification will not be sent when the tab is already the selected tab.
2115 - (void)tabSelected:(Tab*)tab { 2119 - (void)tabSelected:(Tab*)tab {
2116 DCHECK(tab); 2120 DCHECK(tab);
2117 2121
2118 // Ignore changes while the tab stack view is visible (or while suspended). 2122 // Ignore changes while the tab stack view is visible (or while suspended).
(...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after
5018 5022
5019 - (UIView*)voiceSearchButton { 5023 - (UIView*)voiceSearchButton {
5020 return _voiceSearchButton; 5024 return _voiceSearchButton;
5021 } 5025 }
5022 5026
5023 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5027 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5024 return [self currentLogoAnimationControllerOwner]; 5028 return [self currentLogoAnimationControllerOwner];
5025 } 5029 }
5026 5030
5027 @end 5031 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698