Commit 2e124393 authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

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

As part of preparing for multi-window, the URLLoadingService needs
to be migrated to be a BrowserAgent instead of a KeyedService. That
change is itself fairly large, but as an additional complication
URLLoadingService is used in downstream code.

This CL is the tenth and final 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. (crrev.com/c/2106578) Upstream, call only the new shimless API.
   Remove the shim implementation in calling code.
9. Downstream, remove the shimmed API.
10.Upstream, remove the shimmed API, including the shim definition.

Bug: 1046374
Change-Id: I7724b3d552239a67585495e7dd5a3f82630a9c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106849
Commit-Queue: Mark Cogan <marq@chromium.org>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752031}
parent 7f7e483d
......@@ -20,10 +20,6 @@ class ChromiumBrowserProvider : public ios::ChromeBrowserProvider {
ios::ChromeIdentityService* GetChromeIdentityService() override;
UITextField* CreateStyledTextField() const override NS_RETURNS_RETAINED;
VoiceSearchProvider* GetVoiceSearchProvider() const override;
id<LogoVendor> CreateLogoVendor(
Browser* browser,
web::WebState* web_state,
id<URLLoadingBridge> loading_bridge) const override NS_RETURNS_RETAINED;
id<LogoVendor> CreateLogoVendor(Browser* browser, web::WebState* web_state)
const override NS_RETURNS_RETAINED;
......
......@@ -66,13 +66,6 @@ VoiceSearchProvider* ChromiumBrowserProvider::GetVoiceSearchProvider() const {
return voice_search_provider_.get();
}
id<LogoVendor> ChromiumBrowserProvider::CreateLogoVendor(
Browser* browser,
web::WebState* web_state,
id<URLLoadingBridge> loading_bridge) const {
return CreateLogoVendor(browser, web_state);
}
id<LogoVendor> ChromiumBrowserProvider::CreateLogoVendor(
Browser* browser,
web::WebState* web_state) const {
......
......@@ -15,7 +15,6 @@ source_set("browser") {
"geolocation_updater_provider.mm",
"overrides_provider.h",
"overrides_provider.mm",
"url_loading_bridge.h",
]
deps = [
"//base",
......
......@@ -39,7 +39,6 @@ class WebState;
class GURL;
@protocol LogoVendor;
@protocol URLLoadingBridge;
@class UITextField;
@class UIView;
class Browser;
......@@ -135,11 +134,6 @@ class ChromeBrowserProvider {
// Returns an instance of the app distribution provider.
virtual AppDistributionProvider* GetAppDistributionProvider() const;
virtual id<LogoVendor> CreateLogoVendor(
Browser* browser,
web::WebState* web_state,
id<URLLoadingBridge> loading_bridge) const NS_RETURNS_RETAINED;
virtual id<LogoVendor> CreateLogoVendor(Browser* browser,
web::WebState* web_state) const
NS_RETURNS_RETAINED;
......
......@@ -98,13 +98,6 @@ AppDistributionProvider* ChromeBrowserProvider::GetAppDistributionProvider()
return nullptr;
}
id<LogoVendor> ChromeBrowserProvider::CreateLogoVendor(
Browser* browser,
web::WebState* web_state,
id<URLLoadingBridge> loading_bridge) const {
return nil;
}
id<LogoVendor> ChromeBrowserProvider::CreateLogoVendor(
Browser* browser,
web::WebState* web_state) const {
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_URL_LOADING_BRIDGE_H_
#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_URL_LOADING_BRIDGE_H_
#import "url/gurl.h"
// A temporary bridge protocol to change the class used to load URLs.
@protocol URLLoadingBridge <NSObject>
// Asks the implementer to load |URL| in response to a tappable logo.
- (void)loadLogoURL:(GURL)URL;
@end
#endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_URL_LOADING_BRIDGE_H_
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