| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h" | 5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 NSColor* DimTextColor(BOOL is_dark_theme) { | 105 NSColor* DimTextColor(BOOL is_dark_theme) { |
| 106 if (!ui::MaterialDesignController::IsModeMaterial()) { | 106 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 107 return [NSColor darkGrayColor]; | 107 return [NSColor darkGrayColor]; |
| 108 } | 108 } |
| 109 if (is_dark_theme) { | 109 if (is_dark_theme) { |
| 110 return skia::SkColorToSRGBNSColor(SkColorSetA(SK_ColorWHITE, 0x7F)); | 110 return skia::SkColorToSRGBNSColor(SkColorSetA(SK_ColorWHITE, 0x7F)); |
| 111 } | 111 } |
| 112 return skia::SkColorToSRGBNSColor(SkColorSetRGB(0x64, 0x64, 0x64)); | 112 return skia::SkColorToSRGBNSColor(SkColorSetRGB(0x64, 0x64, 0x64)); |
| 113 } | 113 } |
| 114 NSColor* PositiveTextColor() { | 114 NSColor* PositiveTextColor() { |
| 115 return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0x3d, 0x94, 0x00)); | 115 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 116 return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0x3d, 0x94, 0x00)); |
| 117 } |
| 118 return skia::SkColorToSRGBNSColor(SkColorSetRGB(0x3d, 0x94, 0x00)); |
| 116 } | 119 } |
| 117 NSColor* NegativeTextColor() { | 120 NSColor* NegativeTextColor() { |
| 118 return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0xdd, 0x4b, 0x39)); | 121 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 122 return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0xdd, 0x4b, 0x39)); |
| 123 } |
| 124 return skia::SkColorToSRGBNSColor(SkColorSetRGB(0xdd, 0x4b, 0x39)); |
| 119 } | 125 } |
| 120 NSColor* URLTextColor(BOOL is_dark_theme) { | 126 NSColor* URLTextColor(BOOL is_dark_theme) { |
| 121 if (!ui::MaterialDesignController::IsModeMaterial()) { | 127 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 122 return [NSColor colorWithCalibratedRed:0.0 green:0.55 blue:0.0 alpha:1.0]; | 128 return [NSColor colorWithCalibratedRed:0.0 green:0.55 blue:0.0 alpha:1.0]; |
| 123 } | 129 } |
| 124 return is_dark_theme ? skia::SkColorToSRGBNSColor(gfx::kGoogleBlue300) | 130 return is_dark_theme ? skia::SkColorToSRGBNSColor(gfx::kGoogleBlue300) |
| 125 : skia::SkColorToSRGBNSColor(gfx::kGoogleBlue700); | 131 : skia::SkColorToSRGBNSColor(gfx::kGoogleBlue700); |
| 126 } | 132 } |
| 127 | 133 |
| 128 NSFont* FieldFont() { | 134 NSFont* FieldFont() { |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 return base::i18n::IsRTL() ? (inputWidth - glyphOffset) : glyphOffset; | 715 return base::i18n::IsRTL() ? (inputWidth - glyphOffset) : glyphOffset; |
| 710 } | 716 } |
| 711 | 717 |
| 712 + (NSAttributedString*)createSeparatorStringForDarkTheme:(BOOL)isDarkTheme { | 718 + (NSAttributedString*)createSeparatorStringForDarkTheme:(BOOL)isDarkTheme { |
| 713 base::string16 raw_separator = | 719 base::string16 raw_separator = |
| 714 l10n_util::GetStringUTF16(IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR); | 720 l10n_util::GetStringUTF16(IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR); |
| 715 return CreateAttributedString(raw_separator, DimTextColor(isDarkTheme)); | 721 return CreateAttributedString(raw_separator, DimTextColor(isDarkTheme)); |
| 716 } | 722 } |
| 717 | 723 |
| 718 @end | 724 @end |
| OLD | NEW |