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

Side by Side Diff: ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm

Issue 2631233002: Fix the order in which the iOS Tab Switcher cells are initialized. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/tab_switcher/tab_switcher_panel_cell.h" 5 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #import "ios/chrome/browser/tabs/tab.h" 8 #import "ios/chrome/browser/tabs/tab.h"
9 #import "ios/chrome/browser/ui/fade_truncated_label.h" 9 #import "ios/chrome/browser/ui/fade_truncated_label.h"
10 #import "ios/chrome/browser/ui/image_util.h" 10 #import "ios/chrome/browser/ui/image_util.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 [self contentView].accessibilityLabel = tab.title; 223 [self contentView].accessibilityLabel = tab.title;
224 if (tab.favicon) { 224 if (tab.favicon) {
225 [_favicon setImage:tab.favicon]; 225 [_favicon setImage:tab.favicon];
226 } else { 226 } else {
227 [_favicon setImage:NativeImage(IDR_IOS_OMNIBOX_HTTP)]; 227 [_favicon setImage:NativeImage(IDR_IOS_OMNIBOX_HTTP)];
228 } 228 }
229 229
230 CGSize snapshotSize = cellSize; 230 CGSize snapshotSize = cellSize;
231 snapshotSize.height -= tabSwitcherLocalSessionCellTopBarHeight(); 231 snapshotSize.height -= tabSwitcherLocalSessionCellTopBarHeight();
232 base::WeakNSObject<TabSwitcherLocalSessionCell> weakCell(self); 232 base::WeakNSObject<TabSwitcherLocalSessionCell> weakCell(self);
233 DCHECK([self cache]);
lpromero 2017/01/16 18:03:21 Can you add a comment in the header for setAppeara
233 _currentPendingSnapshotRequest = 234 _currentPendingSnapshotRequest =
234 [[self cache] requestSnapshotForTab:tab 235 [[self cache] requestSnapshotForTab:tab
235 withSize:snapshotSize 236 withSize:snapshotSize
236 completionBlock:^(UIImage* image) { 237 completionBlock:^(UIImage* image) {
237 DCHECK([NSThread isMainThread]); 238 DCHECK([NSThread isMainThread]);
238 [weakCell setSnapshot:image]; 239 [weakCell setSnapshot:image];
239 _currentPendingSnapshotRequest = {}; 240 _currentPendingSnapshotRequest = {};
240 }]; 241 }];
241 } 242 }
242 243
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 - (void)prepareForReuse { 434 - (void)prepareForReuse {
434 [_newTabIcon setAlpha:0]; 435 [_newTabIcon setAlpha:0];
435 [_faviconObtainer cancel]; 436 [_faviconObtainer cancel];
436 _faviconObtainer.reset(); 437 _faviconObtainer.reset();
437 [_raisedButton setAlpha:0]; 438 [_raisedButton setAlpha:0];
438 [_raisedButton resetState]; 439 [_raisedButton resetState];
439 [super prepareForReuse]; 440 [super prepareForReuse];
440 } 441 }
441 442
442 @end 443 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698