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

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

Issue 1959473002: [Mac][Material Design] Fix ManagePasswordsDecoration unit tests (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/manage_passwords_decoration_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 aa520b21e72c677caf40afccec46a6345f19727e..3074cc170c83025cb19cd5224b729f334f5b0996 100644
--- a/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm
@@ -92,8 +92,10 @@ void ManagePasswordsDecoration::UpdateUIState() {
SetImage(OmniboxViewMac::ImageForResource(icon_->icon_id()));
return;
}
- bool location_bar_is_dark = [[location_bar_->GetAutocompleteTextField()
- window] inIncognitoModeWithSystemTheme];
+ // |location_bar_| can be NULL in tests.
+ bool location_bar_is_dark = location_bar_ &&
+ [[location_bar_->GetAutocompleteTextField() window]
+ inIncognitoModeWithSystemTheme];
SetImage(GetMaterialIcon(location_bar_is_dark));
}
@@ -108,5 +110,7 @@ void ManagePasswordsDecoration::HideBubble() {
}
gfx::VectorIconId ManagePasswordsDecoration::GetMaterialVectorIconId() const {
+ // Note: update unit tests if this vector id ever changes (it's hard-coded
+ // there).
return gfx::VectorIconId::AUTOLOGIN;
}
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698