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

Side by Side Diff: ios/chrome/browser/ui/ntp/google_landing_mediator.mm

Issue 2816383002: Remove non-const version of GetDefaultSearchProvider() and make all callers call the const version (Closed)
Patch Set: Fix unit test (the model was already loaded) Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/ntp/google_landing_mediator.h" 5 #import "ios/chrome/browser/ui/ntp/google_landing_mediator.h"
6 6
7 #import "base/ios/weak_nsobject.h" 7 #import "base/ios/weak_nsobject.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "base/metrics/user_metrics.h" 9 #include "base/metrics/user_metrics.h"
10 #include "base/metrics/user_metrics_action.h" 10 #include "base/metrics/user_metrics_action.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 new NotificationPromoWhatsNew(GetApplicationContext()->GetLocalState())); 201 new NotificationPromoWhatsNew(GetApplicationContext()->GetLocalState()));
202 _notification_promo->Init(); 202 _notification_promo->Init();
203 [_consumer setPromoText:[base::SysUTF8ToNSString( 203 [_consumer setPromoText:[base::SysUTF8ToNSString(
204 _notification_promo->promo_text()) copy]]; 204 _notification_promo->promo_text()) copy]];
205 [_consumer setPromoIcon:_notification_promo->icon()]; 205 [_consumer setPromoIcon:_notification_promo->icon()];
206 [_consumer setPromoCanShow:_notification_promo->CanShow()]; 206 [_consumer setPromoCanShow:_notification_promo->CanShow()];
207 } 207 }
208 208
209 - (void)updateShowLogo { 209 - (void)updateShowLogo {
210 BOOL showLogo = NO; 210 BOOL showLogo = NO;
211 TemplateURL* defaultURL = _templateURLService->GetDefaultSearchProvider(); 211 const TemplateURL* defaultURL =
212 _templateURLService->GetDefaultSearchProvider();
212 if (defaultURL) { 213 if (defaultURL) {
213 showLogo = 214 showLogo =
214 defaultURL->GetEngineType(_templateURLService->search_terms_data()) == 215 defaultURL->GetEngineType(_templateURLService->search_terms_data()) ==
215 SEARCH_ENGINE_GOOGLE; 216 SEARCH_ENGINE_GOOGLE;
216 } 217 }
217 [self.consumer setLogoIsShowing:showLogo]; 218 [self.consumer setLogoIsShowing:showLogo];
218 } 219 }
219 220
220 + (NSUInteger)maxSitesShown { 221 + (NSUInteger)maxSitesShown {
221 return kMaxNumMostVisitedFavicons; 222 return kMaxNumMostVisitedFavicons;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 384
384 - (void)onFakeboxBlur { 385 - (void)onFakeboxBlur {
385 [_focuser onFakeboxBlur]; 386 [_focuser onFakeboxBlur];
386 } 387 }
387 388
388 - (void)onFakeboxAnimationComplete { 389 - (void)onFakeboxAnimationComplete {
389 [_focuser onFakeboxAnimationComplete]; 390 [_focuser onFakeboxAnimationComplete];
390 } 391 }
391 392
392 @end 393 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698