Commit 954c6080 authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

[iOS] Migrate away from downstream URLLoadingService use (8/10)

This CL is the eighth in a series of changes needed to complete this
refactor:

1. (crrev.com/c/2089687) Add a new provider API upstream that passes
   both a Browser and temporary URL loading shim to CreateLogoVendor.
2. Implement this new API downstream and add support for initializing
   the LogoController with both Browser and the loading shim. Use the
   loading shim for loading URLs if it is present.
3. (crrev.com/c/2089785) Upstream, call the new CreateLogoVendor() API.
4. Downstream, remove support for the old CreateLogoVendor() API and
   update LogoController to only be initialized with a Browser and the
   shim loader. Remove downstream use of the URLLoadingService.
5. (crrev.com/c/2105314) Upstream, refactor URLLoadingService to be
   URLLoadingBrowserAgent, updating the upstream implementation of the
   loading shim passed downstream in CreateLogoVendor().
6. (crrev.com/c/2106182) Upstream, add a new provider API that no longer
   passes the loading shim into CreateLogoVendor(). Delete the now-
   unused provider API that was removed downstream in step 4.
7. Downstream, remove use of the loading shim from LogoController and
   have it fetch the URLLoadingBrowserAgent from its Browser parameter.
   Implement the new shim-less CreateLogoVendor() API. Have the old
   shimmed API call the new shimless one.
8. Upstream, call only the new shimless API. Remove the shim implemen-
   tation in calling code.
9. Downstream, remove the shimmed API.
10.Upstream, remove the shimmed API, including the shim definition.

Specifically, this CL removes the implementation of the URLLoadingBridge
protocol in ContentSuggestionsCoordinator, and has it call the bridge-
less CreateLogoVendor() API.

Bug: 1046374
Change-Id: I071659526f5e54842ed865ad4cfb8d04f3b788b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106578
Commit-Queue: Mark Cogan <marq@chromium.org>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751967}
parent cd858876
...@@ -46,10 +46,8 @@ ...@@ -46,10 +46,8 @@
#import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h" #import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/browser/url_loading/url_loading_browser_agent.h" #import "ios/chrome/browser/url_loading/url_loading_browser_agent.h"
#import "ios/chrome/browser/url_loading/url_loading_params.h"
#import "ios/chrome/browser/voice/voice_search_availability.h" #import "ios/chrome/browser/voice/voice_search_availability.h"
#import "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h"
#import "ios/public/provider/chrome/browser/url_loading_bridge.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -57,8 +55,7 @@ ...@@ -57,8 +55,7 @@
@interface ContentSuggestionsCoordinator () < @interface ContentSuggestionsCoordinator () <
ContentSuggestionsViewControllerAudience, ContentSuggestionsViewControllerAudience,
OverscrollActionsControllerDelegate, OverscrollActionsControllerDelegate> {
URLLoadingBridge> {
// Helper object managing the availability of the voice search feature. // Helper object managing the availability of the voice search feature.
VoiceSearchAvailability _voiceSearchAvailability; VoiceSearchAvailability _voiceSearchAvailability;
} }
...@@ -128,7 +125,7 @@ ...@@ -128,7 +125,7 @@
identityManager:IdentityManagerFactory::GetForBrowserState( identityManager:IdentityManagerFactory::GetForBrowserState(
self.browserState) self.browserState)
logoVendor:ios::GetChromeBrowserProvider()->CreateLogoVendor( logoVendor:ios::GetChromeBrowserProvider()->CreateLogoVendor(
self.browser, self.webState, self) self.browser, self.webState)
voiceSearchAvailability:&_voiceSearchAvailability]; voiceSearchAvailability:&_voiceSearchAvailability];
self.headerController = [[ContentSuggestionsHeaderViewController alloc] init]; self.headerController = [[ContentSuggestionsHeaderViewController alloc] init];
...@@ -286,15 +283,6 @@ ...@@ -286,15 +283,6 @@
return height + topInset; return height + topInset;
} }
#pragma mark - URLLoadingBridge
- (void)loadLogoURL:(GURL)URL {
UrlLoadParams params = UrlLoadParams::InCurrentTab(URL);
params.web_params.transition_type = ui::PageTransitionFromInt(
ui::PAGE_TRANSITION_LINK | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
UrlLoadingBrowserAgent::FromBrowser(self.browser)->Load(params);
}
#pragma mark - Public methods #pragma mark - Public methods
- (UIView*)view { - (UIView*)view {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment