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

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: 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..05f7ce8cc72337e5b714f0518f472333b9a587c2 100644
--- a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
@@ -62,6 +62,10 @@ const CGFloat kTextMarginPadding = 4;
const CGFloat kIconMarginPadding = 2;
const CGFloat kBorderPadding = 3;
+// Color of the vector graphic icons. Used when the location is not dark.
+// SkColorSetARGB(0xCC, 0xFF, 0xFF 0xFF);
+const SkColor kVectorIconColor = 0xCCFFFFFF;
+
// Different states in which the animation can be. In |kOpening|, the text
// is getting larger. In |kOpen|, the text should be displayed at full size.
// In |kClosing|, the text is again getting smaller. The durations in which
@@ -182,14 +186,16 @@ 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());
+ SkColor icon_color =
+ owner_->IsLocationBarDark() ? kVectorIconColor : gfx::kChromeIconGrey;
+ SetImage(content_setting_image_model_->GetIcon(icon_color).ToNSImage());
+
SetToolTip(
base::SysUTF16ToNSString(content_setting_image_model_->get_tooltip()));
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698