| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 328 } |
| 329 | 329 |
| 330 - (BOOL)wantsLocationBarHintText { | 330 - (BOOL)wantsLocationBarHintText { |
| 331 // Always show hint text on iPhone. | 331 // Always show hint text on iPhone. |
| 332 if (!IsIPadIdiom()) | 332 if (!IsIPadIdiom()) |
| 333 return YES; | 333 return YES; |
| 334 // Always show the location bar hint text if the search engine is not Google. | 334 // Always show the location bar hint text if the search engine is not Google. |
| 335 TemplateURLService* service = | 335 TemplateURLService* service = |
| 336 ios::TemplateURLServiceFactory::GetForBrowserState(browserState_); | 336 ios::TemplateURLServiceFactory::GetForBrowserState(browserState_); |
| 337 if (service) { | 337 if (service) { |
| 338 TemplateURL* defaultURL = service->GetDefaultSearchProvider(); | 338 const TemplateURL* defaultURL = service->GetDefaultSearchProvider(); |
| 339 if (defaultURL && | 339 if (defaultURL && |
| 340 defaultURL->GetEngineType(service->search_terms_data()) != | 340 defaultURL->GetEngineType(service->search_terms_data()) != |
| 341 SEARCH_ENGINE_GOOGLE) { | 341 SEARCH_ENGINE_GOOGLE) { |
| 342 return YES; | 342 return YES; |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 | 345 |
| 346 // Always return true when incognito. | 346 // Always return true when incognito. |
| 347 if (browserState_->IsOffTheRecord()) | 347 if (browserState_->IsOffTheRecord()) |
| 348 return YES; | 348 return YES; |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 709 |
| 710 - (void)updateNtpBarShadowForPanelController: | 710 - (void)updateNtpBarShadowForPanelController: |
| 711 (id<NewTabPagePanelProtocol>)ntpPanelController { | 711 (id<NewTabPagePanelProtocol>)ntpPanelController { |
| 712 if (currentController_ != ntpPanelController) | 712 if (currentController_ != ntpPanelController) |
| 713 return; | 713 return; |
| 714 [self.ntpView.tabBar | 714 [self.ntpView.tabBar |
| 715 setShadowAlpha:[ntpPanelController alphaForBottomShadow]]; | 715 setShadowAlpha:[ntpPanelController alphaForBottomShadow]]; |
| 716 } | 716 } |
| 717 | 717 |
| 718 @end | 718 @end |
| OLD | NEW |