Index: ios/chrome/browser/ui/fancy_ui/primary_action_button.mm |
diff --git a/ios/chrome/browser/ui/fancy_ui/primary_action_button.mm b/ios/chrome/browser/ui/fancy_ui/primary_action_button.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b8827323daa8e157d634ed798cd1805030cafc8f |
--- /dev/null |
+++ b/ios/chrome/browser/ui/fancy_ui/primary_action_button.mm |
@@ -0,0 +1,42 @@ |
+// Copyright 2012 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. |
+ |
+#import "ios/chrome/browser/ui/fancy_ui/primary_action_button.h" |
+ |
+#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" |
+ |
+@implementation PrimaryActionButton |
+ |
+- (id)initWithFrame:(CGRect)frame { |
+ self = [super initWithFrame:frame]; |
+ if (self) |
+ [self initializeStyling]; |
+ return self; |
+} |
+ |
+- (id)initWithCoder:(NSCoder*)aDecoder { |
+ self = [super initWithCoder:aDecoder]; |
+ if (self) |
+ [self initializeStyling]; |
+ return self; |
+} |
+ |
+- (void)awakeFromNib { |
+ [super awakeFromNib]; |
+ [self initializeStyling]; |
+} |
+ |
+- (void)initializeStyling { |
+ self.hasOpaqueBackground = YES; |
+ self.underlyingColorHint = [UIColor whiteColor]; |
+ self.inkColor = |
+ [[[MDCPalette cr_bluePalette] tint300] colorWithAlphaComponent:0.5f]; |
+ [self setBackgroundColor:[[MDCPalette cr_bluePalette] tint500] |
+ forState:UIControlStateNormal]; |
+ [self setBackgroundColor:[UIColor colorWithWhite:0.6f alpha:1.0f] |
+ forState:UIControlStateDisabled]; |
+ self.customTitleColor = [UIColor whiteColor]; |
+} |
+ |
+@end |