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

Unified Diff: chrome/browser/ui/cocoa/location_bar/manage_passwords_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/manage_passwords_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm b/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm
index 57320bd3dc7c2f9a50eb24f950818a2c443ccd80..86b9b9716fdea15fb187d3d0d1e294a34d0305f8 100644
--- a/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm
@@ -9,7 +9,14 @@
#include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
#include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h"
#include "chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.h"
+#import "chrome/browser/ui/cocoa/themed_window.h"
+#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util_mac.h"
+#include "ui/base/material_design/material_design_controller.h"
+#include "ui/gfx/color_palette.h"
+#include "ui/gfx/image/image_skia_util_mac.h"
+#include "ui/gfx/paint_vector_icon.h"
+#include "ui/gfx/vector_icons_public.h"
// ManagePasswordsIconCocoa
@@ -81,7 +88,22 @@ void ManagePasswordsDecoration::UpdateUIState() {
return;
}
SetVisible(true);
- SetImage(OmniboxViewMac::ImageForResource(icon_->icon_id()));
+ if (!ui::MaterialDesignController::IsModeMaterial()) {
+ SetImage(OmniboxViewMac::ImageForResource(icon_->icon_id()));
+ } else {
+ int resource_id = icon_->icon_id();
+ bool locationBarIsDark =
+ [[location_bar_->GetAutocompleteTextField() window]
+ inIncognitoModeWithSystemTheme];
+ SkColor vectorIconColor = gfx::kGoogleBlue700;
+ if (resource_id != IDR_SAVE_PASSWORD_ACTIVE) {
+ vectorIconColor = locationBarIsDark ? SK_ColorWHITE
+ : gfx::kChromeIconGrey;
+ }
+ NSImage* theImage = NSImageFromImageSkia(gfx::CreateVectorIcon(
+ gfx::VectorIconId::AUTOLOGIN, 16, vectorIconColor));
+ SetImage(theImage);
+ }
}
void ManagePasswordsDecoration::UpdateVisibleUI() {

Powered by Google App Engine
This is Rietveld 408576698