| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_controller.h" | 5 #import "ios/chrome/browser/ui/ntp/google_landing_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
| 10 #import "base/ios/weak_nsobject.h" | 10 #import "base/ios/weak_nsobject.h" |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 - (void)reparentToolbarController { | 585 - (void)reparentToolbarController { |
| 586 [_headerView reparentToolbarController]; | 586 [_headerView reparentToolbarController]; |
| 587 } | 587 } |
| 588 | 588 |
| 589 - (BOOL)isShowingLogo { | 589 - (BOOL)isShowingLogo { |
| 590 return [_doodleController isShowingLogo]; | 590 return [_doodleController isShowingLogo]; |
| 591 } | 591 } |
| 592 | 592 |
| 593 - (void)updateLogoAndFakeboxDisplay { | 593 - (void)updateLogoAndFakeboxDisplay { |
| 594 BOOL showLogo = NO; | 594 BOOL showLogo = NO; |
| 595 TemplateURL* defaultURL = _templateURLService->GetDefaultSearchProvider(); | 595 const TemplateURL* defaultURL = |
| 596 _templateURLService->GetDefaultSearchProvider(); |
| 596 if (defaultURL) { | 597 if (defaultURL) { |
| 597 showLogo = | 598 showLogo = |
| 598 defaultURL->GetEngineType(_templateURLService->search_terms_data()) == | 599 defaultURL->GetEngineType(_templateURLService->search_terms_data()) == |
| 599 SEARCH_ENGINE_GOOGLE; | 600 SEARCH_ENGINE_GOOGLE; |
| 600 } | 601 } |
| 601 | 602 |
| 602 if (self.showingLogo != showLogo) { | 603 if (self.showingLogo != showLogo) { |
| 603 [_doodleController setShowingLogo:showLogo]; | 604 [_doodleController setShowingLogo:showLogo]; |
| 604 if (_viewLoaded) { | 605 if (_viewLoaded) { |
| 605 [self updateSubviewFrames]; | 606 [self updateSubviewFrames]; |
| (...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 if (!view) { | 1707 if (!view) { |
| 1707 return nil; | 1708 return nil; |
| 1708 } | 1709 } |
| 1709 if ([view isKindOfClass:aClass]) { | 1710 if ([view isKindOfClass:aClass]) { |
| 1710 return view; | 1711 return view; |
| 1711 } | 1712 } |
| 1712 return [self nearestAncestorOfView:[view superview] withClass:aClass]; | 1713 return [self nearestAncestorOfView:[view superview] withClass:aClass]; |
| 1713 } | 1714 } |
| 1714 | 1715 |
| 1715 @end | 1716 @end |
| OLD | NEW |