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

Unified Diff: ios/chrome/browser/ui/fancy_ui/tinted_button.mm

Issue 2934463002: [iOS] Add experimental new keyboard accessory view. (Closed)
Patch Set: Rebased. Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/fancy_ui/tinted_button.h ('k') | ios/chrome/browser/ui/toolbar/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/fancy_ui/tinted_button.mm
diff --git a/ios/chrome/browser/ui/fancy_ui/tinted_button.mm b/ios/chrome/browser/ui/fancy_ui/tinted_button.mm
deleted file mode 100644
index b0c06a608926d0828dde8e096bd77eeb9b319fb9..0000000000000000000000000000000000000000
--- a/ios/chrome/browser/ui/fancy_ui/tinted_button.mm
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ios/chrome/browser/ui/fancy_ui/tinted_button.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-@interface TintedButton () {
- UIColor* normalStateTint_;
- UIColor* highlightedTint_;
-}
-
-// Makes the button's tint color reflect its current state.
-- (void)updateTint;
-
-@end
-
-@implementation TintedButton
-
-- (void)setTintColor:(UIColor*)color forState:(UIControlState)state {
- switch (state) {
- case UIControlStateNormal:
- normalStateTint_ = [color copy];
- break;
- case UIControlStateHighlighted:
- highlightedTint_ = [color copy];
- break;
- default:
- return;
- }
-
- if (normalStateTint_ || highlightedTint_)
- self.adjustsImageWhenHighlighted = NO;
- else
- self.adjustsImageWhenHighlighted = YES;
- [self updateTint];
-}
-
-#pragma mark - UIControl
-
-- (void)setHighlighted:(BOOL)highlighted {
- [super setHighlighted:highlighted];
- [self updateTint];
-}
-
-#pragma mark - Private
-
-- (void)updateTint {
- UIColor* newTint = nil;
- switch (self.state) {
- case UIControlStateNormal:
- newTint = normalStateTint_;
- break;
- case UIControlStateHighlighted:
- newTint = highlightedTint_;
- break;
- default:
- newTint = normalStateTint_;
- break;
- }
- self.tintColor = newTint;
-}
-
-@end
« no previous file with comments | « ios/chrome/browser/ui/fancy_ui/tinted_button.h ('k') | ios/chrome/browser/ui/toolbar/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698