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

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm

Issue 2581513002: Replace hard-coded colors from ui::NativeTheme for consistency and accessibility. (Closed)
Patch Set: Using NativeTheme::GetInstanceForNativeUi() to get NativeThemeMac instance Created 3 years, 12 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
Index: chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm b/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm
index f45e014f0bd4641023ccd98f43feef2ca7dd6992..f7ab340bdaadfd2237e2f3280399dd54a0ac2776 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm
@@ -8,7 +8,6 @@
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/ui/autofill/autofill_popup_controller.h"
#include "chrome/browser/ui/autofill/autofill_popup_layout_model.h"
-#include "chrome/browser/ui/autofill/popup_constants.h"
#include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h"
#include "components/autofill/core/browser/popup_item_ids.h"
#include "components/autofill/core/browser/suggestion.h"
@@ -20,6 +19,8 @@
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/image/image.h"
+#include "ui/native_theme/native_theme.h"
+#include "ui/native_theme/native_theme_mac.h"
using autofill::AutofillPopupView;
using autofill::AutofillPopupLayoutModel;
@@ -160,7 +161,9 @@ using autofill::AutofillPopupLayoutModel;
[[self highlightColor] set];
[NSBezierPath fillRect:bounds];
} else {
- SkColor backgroundColor = controller_->GetBackgroundColorForRow(index);
+ SkColor backgroundColor =
+ ui::NativeTheme::GetInstanceForNativeUi()->GetSystemColor(
+ controller_->GetBackgroundColorIDForRow(index));
[skia::SkColorToSRGBNSColor(backgroundColor) set];
[NSBezierPath fillRect:bounds];
}
@@ -198,7 +201,8 @@ using autofill::AutofillPopupLayoutModel;
bounds:(NSRect)bounds
textYOffset:(CGFloat)textYOffset {
NSColor* nameColor = skia::SkColorToSRGBNSColor(
- controller_->layout_model().GetValueFontColorForRow(index));
+ ui::NativeTheme::GetInstanceForNativeUi()->GetSystemColor(
+ controller_->layout_model().GetValueFontColorIDForRow(index)));
NSDictionary* nameAttributes = [NSDictionary
dictionaryWithObjectsAndKeys:controller_->layout_model()
.GetValueFontListForRow(index)

Powered by Google App Engine
This is Rietveld 408576698