Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/tab_grid/tab_grid_coordinator.mm |
| diff --git a/ios/clean/chrome/browser/ui/tab_grid/tab_grid_coordinator.mm b/ios/clean/chrome/browser/ui/tab_grid/tab_grid_coordinator.mm |
| index 71d1c4e7d05d355c986fca03b2684fd49f1deeef..41f56681f9fec075c6be8b31e89d10c8e98239a2 100644 |
| --- a/ios/clean/chrome/browser/ui/tab_grid/tab_grid_coordinator.mm |
| +++ b/ios/clean/chrome/browser/ui/tab_grid/tab_grid_coordinator.mm |
| @@ -76,6 +76,7 @@ |
| self.viewController = [[TabGridViewController alloc] init]; |
| self.viewController.dispatcher = static_cast<id>(self.browser->dispatcher()); |
| + self.viewController.snapshotCache = [self snapshotCache]; |
| self.mediator.consumer = self.viewController; |
| @@ -286,12 +287,17 @@ |
| __weak TabGridCoordinator* weakSelf = self; |
| webState->TakeSnapshot( |
| base::BindBlockArc(^(const gfx::Image& snapshot) { |
| - SnapshotCache* snapshotCache = SnapshotCacheFactory::GetForBrowserState( |
| - weakSelf.browser->browser_state()); |
| - [snapshotCache setImage:snapshot.ToUIImage() withSessionID:tabID]; |
| + [[weakSelf snapshotCache] setImage:snapshot.ToUIImage() |
| + withSessionID:tabID]; |
| [weakSelf.viewController updateSnapshotAtIndex:index]; |
| }), |
| kTabCollectionTabCellSize); |
| } |
| +// Returns the snapshot cache for this browser state. |
| +- (SnapshotCache*)snapshotCache { |
|
marq (ping after 24h)
2017/07/06 12:44:50
This feels like it should be a readonly property.
edchin
2017/07/07 03:18:11
Done.
|
| + return SnapshotCacheFactory::GetForBrowserState( |
| + self.browser->browser_state()); |
| +} |
| + |
| @end |