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

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

Issue 2167693002: [Autofill] Use AutofillPopupController::GetBackgroundColorForRow on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 33addf6c211895d57761ce0e9d3b3b03e63b9f98..c368b4c19f1f91c46772c5db749c735f1b991f6a 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm
@@ -12,6 +12,8 @@
#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"
+#include "skia/ext/skia_utils_mac.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/cocoa/window_size_constants.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/font_list.h"
@@ -150,10 +152,16 @@ using autofill::AutofillPopupLayoutModel;
bounds:(NSRect)bounds
selected:(BOOL)isSelected
textYOffset:(CGFloat)textYOffset {
- // If this row is selected, highlight it.
+ // If this row is selected, highlight it with this mac system color.
+ // Otherwise the controller may have a specific background color for this
+ // entry.
if (isSelected) {
[[self highlightColor] set];
[NSBezierPath fillRect:bounds];
+ } else {
+ SkColor backgroundColor = controller_->GetBackgroundColorForRow(index);
+ [skia::SkColorToSRGBNSColor(backgroundColor) set];
+ [NSBezierPath fillRect:bounds];
}
BOOL isRTL = controller_->IsRTL();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698