Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: ios/clean/chrome/browser/ui/tab_collection/tab_collection_tab_cell.mm

Issue 2971093002: [ios] Take snapshot for tab grid. (Closed)
Patch Set: Update unit test. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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/clean/chrome/browser/ui/tab_collection/tab_collection_tab_cell.h" 5 #import "ios/clean/chrome/browser/ui/tab_collection/tab_collection_tab_cell.h"
6 6
7 #import "ios/chrome/browser/snapshots/snapshot_cache.h" 7 #import "ios/chrome/browser/snapshots/snapshot_cache.h"
8 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_button.h" 8 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_button.h"
9 #import "ios/chrome/browser/ui/uikit_ui_util.h" 9 #import "ios/chrome/browser/ui/uikit_ui_util.h"
10 #include "ios/chrome/grit/ios_theme_resources.h" 10 #include "ios/chrome/grit/ios_theme_resources.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 self.snapshotButton.accessibilityIdentifier = 57 self.snapshotButton.accessibilityIdentifier =
58 [NSString stringWithFormat:@"%@_button", item.title]; 58 [NSString stringWithFormat:@"%@_button", item.title];
59 self.contentView.accessibilityLabel = item.title; 59 self.contentView.accessibilityLabel = item.title;
60 self.favicon.image = NativeImage(IDR_IOS_OMNIBOX_HTTP); 60 self.favicon.image = NativeImage(IDR_IOS_OMNIBOX_HTTP);
61 __weak TabCollectionTabCell* weakSelf = self; 61 __weak TabCollectionTabCell* weakSelf = self;
62 [snapshotCache 62 [snapshotCache
63 retrieveImageForSessionID:self.item.tabID 63 retrieveImageForSessionID:self.item.tabID
64 callback:^(UIImage* snapshot) { 64 callback:^(UIImage* snapshot) {
65 // PLACEHOLDER: This operation will be cancellable. 65 // PLACEHOLDER: This operation will be cancellable.
66 if ([weakSelf.item.tabID isEqualToString:item.tabID]) { 66 if ([weakSelf.item.tabID isEqualToString:item.tabID]) {
67 [weakSelf setSnapshot:snapshot]; 67 weakSelf.snapshot = snapshot;
68 } 68 }
69 }]; 69 }];
70 } 70 }
71 71
72 #pragma mark - Private methods 72 #pragma mark - Private methods
73 73
74 - (void)setupSelectedBackgroundView { 74 - (void)setupSelectedBackgroundView {
75 self.selectedBackgroundView = [[UIView alloc] init]; 75 self.selectedBackgroundView = [[UIView alloc] init];
76 self.selectedBackgroundView.backgroundColor = [UIColor blackColor]; 76 self.selectedBackgroundView.backgroundColor = [UIColor blackColor];
77 77
(...skipping 14 matching lines...) Expand all
92 [border.trailingAnchor 92 [border.trailingAnchor
93 constraintEqualToAnchor:self.selectedBackgroundView.trailingAnchor 93 constraintEqualToAnchor:self.selectedBackgroundView.trailingAnchor
94 constant:kBorderMargin], 94 constant:kBorderMargin],
95 [border.bottomAnchor 95 [border.bottomAnchor
96 constraintEqualToAnchor:self.selectedBackgroundView.bottomAnchor 96 constraintEqualToAnchor:self.selectedBackgroundView.bottomAnchor
97 constant:kBorderMargin] 97 constant:kBorderMargin]
98 ]]; 98 ]];
99 } 99 }
100 100
101 @end 101 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698