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

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

Issue 1955083003: [Material Design] Update Website Setting Icons in Omnibox on OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch for shrike's review Created 4 years, 7 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/content_setting_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
index 6831b3d29e430b5db0684f2bdc4fde39287a8406..a89e3e0ffb4667b76b838213c6920c59f8d381b2 100644
--- a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
@@ -182,14 +182,17 @@ ContentSettingDecoration::~ContentSettingDecoration() {
bool ContentSettingDecoration::UpdateFromWebContents(
WebContents* web_contents) {
bool was_visible = IsVisible();
- int old_icon = content_setting_image_model_->raster_icon_id();
- content_setting_image_model_->UpdateFromWebContents(web_contents);
+ bool did_icon_change =
+ content_setting_image_model_->UpdateFromWebContentsAndCheckIfIconChanged(
+ web_contents);
SetVisible(content_setting_image_model_->is_visible());
- bool decoration_changed =
- was_visible != IsVisible() ||
- old_icon != content_setting_image_model_->raster_icon_id();
+ bool decoration_changed = was_visible != IsVisible() || did_icon_change;
if (IsVisible()) {
- SetImage(content_setting_image_model_->raster_icon().ToNSImage());
shrike 2016/05/10 15:45:41 One more thing: we have to keep around the old cod
+ SkColor icon_color = owner_->IsLocationBarDark()
+ ? SkColorSetA(SK_ColorWHITE, 0xCC)
Nico 2016/05/11 19:13:33 we try to use named constants instead of putting m
spqchan 2016/05/12 17:40:04 Done.
+ : gfx::kChromeIconGrey;
+ SetImage(content_setting_image_model_->GetIcon(icon_color).ToNSImage());
+
SetToolTip(
base::SysUTF16ToNSString(content_setting_image_model_->get_tooltip()));

Powered by Google App Engine
This is Rietveld 408576698