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

Side by Side Diff: ios/chrome/browser/ui/ntp/new_tab_page_controller.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
« no previous file with comments | « ios/chrome/browser/ui/ntp/google_landing_mediator.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ntp/new_tab_page_controller.h" 5 #import "ios/chrome/browser/ui/ntp/new_tab_page_controller.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #import "base/ios/weak_nsobject.h" 9 #import "base/ios/weak_nsobject.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 346 }
347 347
348 - (BOOL)wantsLocationBarHintText { 348 - (BOOL)wantsLocationBarHintText {
349 // Always show hint text on iPhone. 349 // Always show hint text on iPhone.
350 if (!IsIPadIdiom()) 350 if (!IsIPadIdiom())
351 return YES; 351 return YES;
352 // Always show the location bar hint text if the search engine is not Google. 352 // Always show the location bar hint text if the search engine is not Google.
353 TemplateURLService* service = 353 TemplateURLService* service =
354 ios::TemplateURLServiceFactory::GetForBrowserState(browserState_); 354 ios::TemplateURLServiceFactory::GetForBrowserState(browserState_);
355 if (service) { 355 if (service) {
356 TemplateURL* defaultURL = service->GetDefaultSearchProvider(); 356 const TemplateURL* defaultURL = service->GetDefaultSearchProvider();
357 if (defaultURL && 357 if (defaultURL &&
358 defaultURL->GetEngineType(service->search_terms_data()) != 358 defaultURL->GetEngineType(service->search_terms_data()) !=
359 SEARCH_ENGINE_GOOGLE) { 359 SEARCH_ENGINE_GOOGLE) {
360 return YES; 360 return YES;
361 } 361 }
362 } 362 }
363 363
364 // Always return true when incognito. 364 // Always return true when incognito.
365 if (browserState_->IsOffTheRecord()) 365 if (browserState_->IsOffTheRecord())
366 return YES; 366 return YES;
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 731
732 - (void)updateNtpBarShadowForPanelController: 732 - (void)updateNtpBarShadowForPanelController:
733 (id<NewTabPagePanelProtocol>)ntpPanelController { 733 (id<NewTabPagePanelProtocol>)ntpPanelController {
734 if (currentController_ != ntpPanelController) 734 if (currentController_ != ntpPanelController)
735 return; 735 return;
736 [self.ntpView.tabBar 736 [self.ntpView.tabBar
737 setShadowAlpha:[ntpPanelController alphaForBottomShadow]]; 737 setShadowAlpha:[ntpPanelController alphaForBottomShadow]];
738 } 738 }
739 739
740 @end 740 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/ntp/google_landing_mediator.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698