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

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

Issue 2709563002: [tab_grid] Hack-in border for active tab. (Closed)
Patch Set: [tab_grid] Hack-in border for active tab. Created 3 years, 10 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 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 [[_containerView layer] setMasksToBounds:YES]; 68 [[_containerView layer] setMasksToBounds:YES];
69 [[self contentView] addSubview:_containerView]; 69 [[self contentView] addSubview:_containerView];
70 [self updateShadow]; 70 [self updateShadow];
71 [[[self contentView] layer] setShouldRasterize:YES]; 71 [[[self contentView] layer] setShouldRasterize:YES];
72 [[[self contentView] layer] 72 [[[self contentView] layer]
73 setRasterizationScale:[[UIScreen mainScreen] scale]]; 73 setRasterizationScale:[[UIScreen mainScreen] scale]];
74 } 74 }
75 return self; 75 return self;
76 } 76 }
77 77
78 // PLACEHOLDER: This will be refined to UI mocks.
marq (ping after 24h) 2017/02/23 11:04:30 I don't want to put placeholder code into ios/chro
edchin 2017/02/23 17:41:54 Good suggestion. Done.
jif 2017/02/23 17:43:21 Or duplicate it in ios/clean?
79 // Sets border around selected cell.
80 - (void)setSelected:(BOOL)selected {
81 [super setSelected:selected];
82 if (selected) {
83 self.layer.cornerRadius = 2.0f;
84 self.layer.borderWidth = 4.0f;
85 self.layer.borderColor = self.tintColor.CGColor;
86 } else {
87 self.layer.borderWidth = 0.0f;
88 }
89 }
90
78 - (void)layoutSubviews { 91 - (void)layoutSubviews {
79 [super layoutSubviews]; 92 [super layoutSubviews];
80 [self updateShadow]; 93 [self updateShadow];
81 } 94 }
82 95
83 - (void)updateShadow { 96 - (void)updateShadow {
84 if (!CGSizeEqualToSize(_cachedShadowSize, self.bounds.size)) { 97 if (!CGSizeEqualToSize(_cachedShadowSize, self.bounds.size)) {
85 CGRect offsetedRectangle = CGRectOffset(self.bounds, 0, 6); 98 CGRect offsetedRectangle = CGRectOffset(self.bounds, 0, 6);
86 UIBezierPath* shadowPath = 99 UIBezierPath* shadowPath =
87 [UIBezierPath bezierPathWithRoundedRect:offsetedRectangle 100 [UIBezierPath bezierPathWithRoundedRect:offsetedRectangle
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 - (void)prepareForReuse { 464 - (void)prepareForReuse {
452 [_newTabIcon setAlpha:0]; 465 [_newTabIcon setAlpha:0];
453 [_faviconObtainer cancel]; 466 [_faviconObtainer cancel];
454 _faviconObtainer.reset(); 467 _faviconObtainer.reset();
455 [_raisedButton setAlpha:0]; 468 [_raisedButton setAlpha:0];
456 [_raisedButton resetState]; 469 [_raisedButton resetState];
457 [super prepareForReuse]; 470 [super prepareForReuse];
458 } 471 }
459 472
460 @end 473 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698