OLD | NEW |
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 #include "ios/chrome/browser/ui/toolbar/toolbar_button_tints.h" | 5 #include "ios/chrome/browser/ui/toolbar/toolbar_button_tints.h" |
6 | 6 |
7 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 7 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
8 | 8 |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 10 #error "This file requires ARC support." |
| 11 #endif |
| 12 |
9 namespace toolbar { | 13 namespace toolbar { |
10 | 14 |
11 // The colors used to tint the buttons in the toolbar. | 15 // The colors used to tint the buttons in the toolbar. |
12 const int kLightModeNormalColor = 0x5A5A5A; | 16 const int kLightModeNormalColor = 0x5A5A5A; |
13 const int kIncognitoModeNormalColor = 0xFFFFFF; | 17 const int kIncognitoModeNormalColor = 0xFFFFFF; |
14 const int kDarkModeNormalColor = 0xFFFFFF; | 18 const int kDarkModeNormalColor = 0xFFFFFF; |
15 const int kPressedColor = 0x4285F4; | 19 const int kPressedColor = 0x4285F4; |
16 | 20 |
17 UIColor* NormalButtonTint(ToolbarControllerStyle style) { | 21 UIColor* NormalButtonTint(ToolbarControllerStyle style) { |
18 switch (style) { | 22 switch (style) { |
19 case ToolbarControllerStyleLightMode: | 23 case ToolbarControllerStyleLightMode: |
20 return UIColorFromRGB(kLightModeNormalColor); | 24 return UIColorFromRGB(kLightModeNormalColor); |
21 case ToolbarControllerStyleIncognitoMode: | 25 case ToolbarControllerStyleIncognitoMode: |
22 return UIColorFromRGB(kIncognitoModeNormalColor); | 26 return UIColorFromRGB(kIncognitoModeNormalColor); |
23 case ToolbarControllerStyleDarkMode: | 27 case ToolbarControllerStyleDarkMode: |
24 return UIColorFromRGB(kDarkModeNormalColor); | 28 return UIColorFromRGB(kDarkModeNormalColor); |
25 case ToolbarControllerStyleMaxStyles: | 29 case ToolbarControllerStyleMaxStyles: |
26 NOTREACHED(); | 30 NOTREACHED(); |
27 return nil; | 31 return nil; |
28 } | 32 } |
29 } | 33 } |
30 | 34 |
31 UIColor* HighlighButtonTint(ToolbarControllerStyle style) { | 35 UIColor* HighlighButtonTint(ToolbarControllerStyle style) { |
32 return UIColorFromRGB(kPressedColor); | 36 return UIColorFromRGB(kPressedColor); |
33 DCHECK_NE(ToolbarControllerStyleMaxStyles, style); | 37 DCHECK_NE(ToolbarControllerStyleMaxStyles, style); |
34 } | 38 } |
35 | 39 |
36 } // namespace toolbar | 40 } // namespace toolbar |
OLD | NEW |