| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/recent_tabs/recent_tabs_panel_controller.h" | 5 #import "ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_panel_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "components/browser_sync/profile_sync_service.h" | 10 #include "components/browser_sync/profile_sync_service.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 CGFloat pixelsBelowFrame = contentHeight - offsetY - scrollViewHeight; | 171 CGFloat pixelsBelowFrame = contentHeight - offsetY - scrollViewHeight; |
| 172 CGFloat alpha = pixelsBelowFrame / kNewTabPageDistanceToFadeShadow; | 172 CGFloat alpha = pixelsBelowFrame / kNewTabPageDistanceToFadeShadow; |
| 173 alpha = MIN(MAX(alpha, 0), 1); | 173 alpha = MIN(MAX(alpha, 0), 1); |
| 174 return alpha; | 174 return alpha; |
| 175 } | 175 } |
| 176 | 176 |
| 177 - (UIView*)view { | 177 - (UIView*)view { |
| 178 return [_tableViewController view]; | 178 return [_tableViewController view]; |
| 179 } | 179 } |
| 180 | 180 |
| 181 - (UIViewController*)viewController { |
| 182 return _tableViewController; |
| 183 } |
| 184 |
| 181 #pragma mark - Private | 185 #pragma mark - Private |
| 182 | 186 |
| 183 - (BOOL)isSignedIn { | 187 - (BOOL)isSignedIn { |
| 184 SigninManager* signin_manager = | 188 SigninManager* signin_manager = |
| 185 ios::SigninManagerFactory::GetForBrowserState(_browserState); | 189 ios::SigninManagerFactory::GetForBrowserState(_browserState); |
| 186 return signin_manager->IsAuthenticated(); | 190 return signin_manager->IsAuthenticated(); |
| 187 } | 191 } |
| 188 | 192 |
| 189 - (BOOL)isSyncTabsEnabled { | 193 - (BOOL)isSyncTabsEnabled { |
| 190 DCHECK([self isSignedIn]); | 194 DCHECK([self isSignedIn]); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 [_tableViewController refreshUserState:[self userSignedInState]]; | 236 [_tableViewController refreshUserState:[self userSignedInState]]; |
| 233 } | 237 } |
| 234 | 238 |
| 235 #pragma mark - RecentTabsTableViewControllerDelegate | 239 #pragma mark - RecentTabsTableViewControllerDelegate |
| 236 | 240 |
| 237 - (void)recentTabsTableViewContentMoved:(UITableView*)tableView { | 241 - (void)recentTabsTableViewContentMoved:(UITableView*)tableView { |
| 238 [self.delegate updateNtpBarShadowForPanelController:self]; | 242 [self.delegate updateNtpBarShadowForPanelController:self]; |
| 239 } | 243 } |
| 240 | 244 |
| 241 @end | 245 @end |
| OLD | NEW |