OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |