| Index: ios/chrome/browser/ui/ntp/google_landing_mediator.mm
|
| diff --git a/ios/chrome/browser/ui/ntp/google_landing_mediator.mm b/ios/chrome/browser/ui/ntp/google_landing_mediator.mm
|
| index 47ae5c43e87f33a41bef14c82233d5e9dc833fc3..cda99e6589b60097d23211fb208264283cc44448 100644
|
| --- a/ios/chrome/browser/ui/ntp/google_landing_mediator.mm
|
| +++ b/ios/chrome/browser/ui/ntp/google_landing_mediator.mm
|
| @@ -4,8 +4,6 @@
|
|
|
| #import "ios/chrome/browser/ui/ntp/google_landing_mediator.h"
|
|
|
| -#import "base/ios/weak_nsobject.h"
|
| -#include "base/mac/scoped_nsobject.h"
|
| #include "base/metrics/user_metrics.h"
|
| #include "base/metrics/user_metrics_action.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| @@ -38,6 +36,10 @@
|
| #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h"
|
| #include "ios/web/public/web_state/web_state.h"
|
|
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| using base::UserMetricsAction;
|
|
|
| namespace {
|
| @@ -63,7 +65,7 @@ class SearchEngineObserver : public TemplateURLServiceObserver {
|
| void OnTemplateURLServiceChanged() override;
|
|
|
| private:
|
| - base::WeakNSObject<GoogleLandingMediator> _owner;
|
| + __weak GoogleLandingMediator* _owner;
|
| TemplateURLService* _templateURLService; // weak
|
| };
|
|
|
| @@ -93,7 +95,7 @@ void SearchEngineObserver::OnTemplateURLServiceChanged() {
|
| BOOL _recordedPageImpression;
|
|
|
| // Controller to fetch and show doodles or a default Google logo.
|
| - base::scoped_nsprotocol<id<LogoVendor>> _doodleController;
|
| + id<LogoVendor> _doodleController;
|
|
|
| // Listen for default search engine changes.
|
| std::unique_ptr<google_landing::SearchEngineObserver> _observer;
|
| @@ -118,13 +120,13 @@ void SearchEngineObserver::OnTemplateURLServiceChanged() {
|
| }
|
|
|
| // Consumer to handle google landing update notifications.
|
| -@property(nonatomic) id<GoogleLandingConsumer> consumer;
|
| +@property(weak, nonatomic) id<GoogleLandingConsumer> consumer;
|
|
|
| // The WebStateList that is being observed by this mediator.
|
| @property(nonatomic, assign) WebStateList* webStateList;
|
|
|
| // The dispatcher for this mediator.
|
| -@property(nonatomic, assign) id<ChromeExecuteCommand, UrlLoader> dispatcher;
|
| +@property(nonatomic, weak) id<ChromeExecuteCommand, UrlLoader> dispatcher;
|
|
|
| // Most visited data from the MostVisitedSites service (copied upon receiving
|
| // the callback), not yet used.
|
| @@ -191,8 +193,8 @@ void SearchEngineObserver::OnTemplateURLServiceChanged() {
|
| _observer.reset(
|
| new google_landing::SearchEngineObserver(self, _templateURLService));
|
| _templateURLService->Load();
|
| - _doodleController.reset(ios::GetChromeBrowserProvider()->CreateLogoVendor(
|
| - _browserState, self.dispatcher));
|
| + _doodleController = ios::GetChromeBrowserProvider()->CreateLogoVendor(
|
| + _browserState, self.dispatcher);
|
| [_consumer setLogoVendor:_doodleController];
|
| [self updateShowLogo];
|
|
|
| @@ -371,9 +373,8 @@ void SearchEngineObserver::OnTemplateURLServiceChanged() {
|
| }
|
|
|
| if (_notification_promo->IsChromeCommand()) {
|
| - base::scoped_nsobject<GenericChromeCommand> command(
|
| - [[GenericChromeCommand alloc]
|
| - initWithTag:_notification_promo->command_id()]);
|
| + GenericChromeCommand* command = [[GenericChromeCommand alloc]
|
| + initWithTag:_notification_promo->command_id()];
|
| [self.dispatcher chromeExecuteCommand:command];
|
| return;
|
| }
|
|
|