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

Unified Diff: chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm

Issue 1718563002: Convert location bar decorations to Material Design (Mac). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@md_toolbar
Patch Set: Fix issue from browser test. Created 4 years, 9 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/location_bar/ev_bubble_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm
index f69af0e865ccdecb210bd22f1773638d03383f38..0547d31263d4c6743a557055be5c0b5c770ca383 100644
--- a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm
@@ -8,6 +8,9 @@
#include "base/strings/sys_string_conversions.h"
#import "chrome/browser/ui/cocoa/location_bar/location_icon_decoration.h"
#include "grit/theme_resources.h"
+#include "skia/ext/skia_utils_mac.h"
+#include "ui/base/material_design/material_design_controller.h"
+#include "ui/gfx/color_palette.h"
#include "ui/gfx/font_list.h"
#include "ui/gfx/text_elider.h"
@@ -49,12 +52,20 @@ NSColor* ColorWithRGBBytes(int rr, int gg, int bb) {
EVBubbleDecoration::EVBubbleDecoration(LocationIconDecoration* location_icon)
: location_icon_(location_icon) {
- // Color tuples stolen from location_bar_view_gtk.cc.
- SetTextColor(ColorWithRGBBytes(0x07, 0x95, 0x00));
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ SetTextColor(GetBackgroundBorderColor());
+ } else {
+ // Color tuples stolen from location_bar_view_gtk.cc.
+ SetTextColor(ColorWithRGBBytes(0x07, 0x95, 0x00));
+ }
}
EVBubbleDecoration::~EVBubbleDecoration() {}
+NSColor* EVBubbleDecoration::GetBackgroundBorderColor() {
+ return skia::SkColorToCalibratedNSColor(gfx::kGoogleGreen700);
+}
+
void EVBubbleDecoration::SetFullLabel(NSString* label) {
full_label_.reset([label retain]);
SetLabel(full_label_);

Powered by Google App Engine
This is Rietveld 408576698