| Index: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| index bc3aeeb1ac6fd54b01e7299f60967eb0e28d6767..22d28186f262b1e28fc14d42ed9b9de3cf6fb527 100644
|
| --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| @@ -585,18 +585,31 @@ void LocationBarViewMac::UpdateLocationIcon() {
|
| Layout();
|
| }
|
|
|
| -void LocationBarViewMac::OnAddedToWindow() {
|
| - if (!ui::MaterialDesignController::IsModeMaterial()) {
|
| +void LocationBarViewMac::UpdateColorsToMatchTheme() {
|
| + if (!ui::MaterialDesignController::IsModeMaterial() ||
|
| + ![[field_ window] inIncognitoMode]) {
|
| return;
|
| }
|
|
|
| // Update the location-bar icon.
|
| UpdateLocationIcon();
|
|
|
| - // Make sure we're displaying the correct star color for a dark location bar.
|
| - if ([[field_ window] inIncognitoModeWithSystemTheme]) {
|
| - star_decoration_->SetStarred(star_decoration_->starred(), true);
|
| - }
|
| + // Make sure we're displaying the correct star color for Incognito mode. If
|
| + // the window is in Incognito mode, switching between a theme and no theme
|
| + // can move the window in and out of dark mode.
|
| + bool inDarkMode = [[field_ window] inIncognitoModeWithSystemTheme];
|
| + star_decoration_->SetStarred(star_decoration_->starred(), inDarkMode);
|
| +
|
| + // Update the appearance of the text in the Omnibox.
|
| + omnibox_view_->Update();
|
| +}
|
| +
|
| +void LocationBarViewMac::OnAddedToWindow() {
|
| + UpdateColorsToMatchTheme();
|
| +}
|
| +
|
| +void LocationBarViewMac::OnThemeChanged() {
|
| + UpdateColorsToMatchTheme();
|
| }
|
|
|
| void LocationBarViewMac::OnChanged() {
|
|
|