| 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 "components/browser_sync/profile_sync_service.h" | 9 #include "components/browser_sync/profile_sync_service.h" |
| 10 #include "components/sessions/core/tab_restore_service.h" | 10 #include "components/sessions/core/tab_restore_service.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 CGFloat pixelsBelowFrame = contentHeight - offsetY - scrollViewHeight; | 173 CGFloat pixelsBelowFrame = contentHeight - offsetY - scrollViewHeight; |
| 174 CGFloat alpha = pixelsBelowFrame / kNewTabPageDistanceToFadeShadow; | 174 CGFloat alpha = pixelsBelowFrame / kNewTabPageDistanceToFadeShadow; |
| 175 alpha = MIN(MAX(alpha, 0), 1); | 175 alpha = MIN(MAX(alpha, 0), 1); |
| 176 return alpha; | 176 return alpha; |
| 177 } | 177 } |
| 178 | 178 |
| 179 - (UIView*)view { | 179 - (UIView*)view { |
| 180 return [_tableViewController view]; | 180 return [_tableViewController view]; |
| 181 } | 181 } |
| 182 | 182 |
| 183 - (UIViewController*)viewController { |
| 184 return _tableViewController; |
| 185 } |
| 186 |
| 183 #pragma mark - Private | 187 #pragma mark - Private |
| 184 | 188 |
| 185 - (BOOL)isSignedIn { | 189 - (BOOL)isSignedIn { |
| 186 SigninManager* signin_manager = | 190 SigninManager* signin_manager = |
| 187 ios::SigninManagerFactory::GetForBrowserState(_browserState); | 191 ios::SigninManagerFactory::GetForBrowserState(_browserState); |
| 188 return signin_manager->IsAuthenticated(); | 192 return signin_manager->IsAuthenticated(); |
| 189 } | 193 } |
| 190 | 194 |
| 191 - (BOOL)isSyncTabsEnabled { | 195 - (BOOL)isSyncTabsEnabled { |
| 192 DCHECK([self isSignedIn]); | 196 DCHECK([self isSignedIn]); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 [_tableViewController refreshUserState:[self userSignedInState]]; | 238 [_tableViewController refreshUserState:[self userSignedInState]]; |
| 235 } | 239 } |
| 236 | 240 |
| 237 #pragma mark - RecentTabsTableViewControllerDelegate | 241 #pragma mark - RecentTabsTableViewControllerDelegate |
| 238 | 242 |
| 239 - (void)recentTabsTableViewContentMoved:(UITableView*)tableView { | 243 - (void)recentTabsTableViewContentMoved:(UITableView*)tableView { |
| 240 [self.delegate updateNtpBarShadowForPanelController:self]; | 244 [self.delegate updateNtpBarShadowForPanelController:self]; |
| 241 } | 245 } |
| 242 | 246 |
| 243 @end | 247 @end |
| OLD | NEW |