| 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 | |
| 13 namespace toolbar { | 9 namespace toolbar { |
| 14 | 10 |
| 15 // The colors used to tint the buttons in the toolbar. | 11 // The colors used to tint the buttons in the toolbar. |
| 16 const int kLightModeNormalColor = 0x5A5A5A; | 12 const int kLightModeNormalColor = 0x5A5A5A; |
| 17 const int kIncognitoModeNormalColor = 0xFFFFFF; | 13 const int kIncognitoModeNormalColor = 0xFFFFFF; |
| 18 const int kDarkModeNormalColor = 0xFFFFFF; | 14 const int kDarkModeNormalColor = 0xFFFFFF; |
| 19 const int kPressedColor = 0x4285F4; | 15 const int kPressedColor = 0x4285F4; |
| 20 | 16 |
| 21 UIColor* NormalButtonTint(ToolbarControllerStyle style) { | 17 UIColor* NormalButtonTint(ToolbarControllerStyle style) { |
| 22 switch (style) { | 18 switch (style) { |
| 23 case ToolbarControllerStyleLightMode: | 19 case ToolbarControllerStyleLightMode: |
| 24 return UIColorFromRGB(kLightModeNormalColor); | 20 return UIColorFromRGB(kLightModeNormalColor); |
| 25 case ToolbarControllerStyleIncognitoMode: | 21 case ToolbarControllerStyleIncognitoMode: |
| 26 return UIColorFromRGB(kIncognitoModeNormalColor); | 22 return UIColorFromRGB(kIncognitoModeNormalColor); |
| 27 case ToolbarControllerStyleDarkMode: | 23 case ToolbarControllerStyleDarkMode: |
| 28 return UIColorFromRGB(kDarkModeNormalColor); | 24 return UIColorFromRGB(kDarkModeNormalColor); |
| 29 case ToolbarControllerStyleMaxStyles: | 25 case ToolbarControllerStyleMaxStyles: |
| 30 NOTREACHED(); | 26 NOTREACHED(); |
| 31 return nil; | 27 return nil; |
| 32 } | 28 } |
| 33 } | 29 } |
| 34 | 30 |
| 35 UIColor* HighlighButtonTint(ToolbarControllerStyle style) { | 31 UIColor* HighlighButtonTint(ToolbarControllerStyle style) { |
| 36 return UIColorFromRGB(kPressedColor); | 32 return UIColorFromRGB(kPressedColor); |
| 37 DCHECK_NE(ToolbarControllerStyleMaxStyles, style); | 33 DCHECK_NE(ToolbarControllerStyleMaxStyles, style); |
| 38 } | 34 } |
| 39 | 35 |
| 40 } // namespace toolbar | 36 } // namespace toolbar |
| OLD | NEW |