OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/chrome/browser/ui/side_swipe/history_side_swipe_provider.h" |
| 6 |
| 7 @interface HistorySideSwipeProvider () { |
| 8 // Keep a reference to detach before deallocing. |
| 9 TabModel* _tabModel; // weak |
| 10 } |
| 11 |
| 12 @end |
| 13 |
| 14 @implementation HistorySideSwipeProvider |
| 15 - (instancetype)initWithTabModel:(TabModel*)tabModel { |
| 16 self = [super init]; |
| 17 if (self) { |
| 18 _tabModel = tabModel; |
| 19 } |
| 20 return self; |
| 21 } |
| 22 |
| 23 - (BOOL)canGoBack { |
| 24 return [[_tabModel currentTab] canGoBack]; |
| 25 } |
| 26 |
| 27 - (BOOL)canGoForward { |
| 28 return [[_tabModel currentTab] canGoForward]; |
| 29 } |
| 30 |
| 31 - (void)goForward:(web::WebState*)webState { |
| 32 [[_tabModel currentTab] goForward]; |
| 33 } |
| 34 |
| 35 - (void)goBack:(web::WebState*)webState { |
| 36 [[_tabModel currentTab] goBack]; |
| 37 } |
| 38 |
| 39 - (UIImage*)paneIcon { |
| 40 return [UIImage imageNamed:@"side_swipe_navigation_back"]; |
| 41 } |
| 42 |
| 43 - (BOOL)rotateForwardIcon { |
| 44 return YES; |
| 45 } |
| 46 |
| 47 @end |
OLD | NEW |