Commit 7aecde21 authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

Ensure omnibox_theme.cc adapts to theme changes.

This is easily done with an override of View::OnThemeChanged()

Less easily done is a test: themes are complex. Add a test for the
selection highlight, which captures the current logic around theme
color propagation.

Bug: 801583, 819425, 704942
Change-Id: I86f3e4d9b5a30db66ad5a28d2ce7581aa9f7320b
Reviewed-on: https://chromium-review.googlesource.com/952802
Commit-Queue: Trent Apted <tapted@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543657}
parent 827ddeb7
......@@ -649,6 +649,10 @@ void LocationBarView::Layout() {
omnibox_view_->SetBoundsRect(location_bounds);
}
void LocationBarView::OnThemeChanged() {
tint_ = GetTintForProfile(profile());
}
void LocationBarView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
RefreshLocationIcon();
RefreshClearAllButtonIcon();
......
......@@ -229,6 +229,7 @@ class LocationBarView : public LocationBar,
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
gfx::Size CalculatePreferredSize() const override;
void Layout() override;
void OnThemeChanged() override;
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
// ChromeOmniboxEditController:
......@@ -431,8 +432,8 @@ class LocationBarView : public LocationBar,
// bar is read-only.
const bool is_popup_mode_;
// The theme tint. Initialized based on the profile and theme settings.
const OmniboxTint tint_;
// The theme tint. Updated based on the profile and theme settings.
OmniboxTint tint_;
// True if we should show a focus rect while the location entry field is
// focused. Used when the toolbar is in full keyboard accessibility mode.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment