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 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1667 } | 1667 } |
1668 | 1668 |
1669 - (void)addBlacklistedURL:(const GURL&)url { | 1669 - (void)addBlacklistedURL:(const GURL&)url { |
1670 _most_visited_sites->AddOrRemoveBlacklistedUrl(url, true); | 1670 _most_visited_sites->AddOrRemoveBlacklistedUrl(url, true); |
1671 } | 1671 } |
1672 | 1672 |
1673 - (void)removeBlacklistedURL:(const GURL&)url { | 1673 - (void)removeBlacklistedURL:(const GURL&)url { |
1674 _most_visited_sites->AddOrRemoveBlacklistedUrl(url, false); | 1674 _most_visited_sites->AddOrRemoveBlacklistedUrl(url, false); |
1675 } | 1675 } |
1676 | 1676 |
| 1677 #pragma mark - GoogleLandingController (ExposedForTesting) methods. |
| 1678 |
1677 - (BOOL)scrolledToTop { | 1679 - (BOOL)scrolledToTop { |
1678 return _scrolledToTop; | 1680 return _scrolledToTop; |
1679 } | 1681 } |
1680 | 1682 |
| 1683 - (BOOL)animateHeader { |
| 1684 return _animateHeader; |
| 1685 } |
| 1686 |
1681 #pragma mark - OverscrollActionsControllerDelegate | 1687 #pragma mark - OverscrollActionsControllerDelegate |
1682 | 1688 |
1683 - (void)overscrollActionsController:(OverscrollActionsController*)controller | 1689 - (void)overscrollActionsController:(OverscrollActionsController*)controller |
1684 didTriggerAction:(ios_internal::OverscrollAction)action { | 1690 didTriggerAction:(ios_internal::OverscrollAction)action { |
1685 switch (action) { | 1691 switch (action) { |
1686 case ios_internal::OverscrollAction::NEW_TAB: { | 1692 case ios_internal::OverscrollAction::NEW_TAB: { |
1687 base::scoped_nsobject<GenericChromeCommand> command( | 1693 base::scoped_nsobject<GenericChromeCommand> command( |
1688 [[GenericChromeCommand alloc] initWithTag:IDC_NEW_TAB]); | 1694 [[GenericChromeCommand alloc] initWithTag:IDC_NEW_TAB]); |
1689 [[self view] chromeExecuteCommand:command]; | 1695 [[self view] chromeExecuteCommand:command]; |
1690 } break; | 1696 } break; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 if (!view) { | 1741 if (!view) { |
1736 return nil; | 1742 return nil; |
1737 } | 1743 } |
1738 if ([view isKindOfClass:aClass]) { | 1744 if ([view isKindOfClass:aClass]) { |
1739 return view; | 1745 return view; |
1740 } | 1746 } |
1741 return [self nearestAncestorOfView:[view superview] withClass:aClass]; | 1747 return [self nearestAncestorOfView:[view superview] withClass:aClass]; |
1742 } | 1748 } |
1743 | 1749 |
1744 @end | 1750 @end |
OLD | NEW |