Commit acea41ce authored by Allen Bauer's avatar Allen Bauer Committed by Commit Bot

Make sure the find bar isn't themed in incognito mode.

Per this comment on linked bug: https://crbug.com/651643#c62

Bug: 651643
Change-Id: Ic90a7a83232d4c3eace025872ef839d68d68d45c
Reviewed-on: https://chromium-review.googlesource.com/823083Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524079}
parent 873b1341
...@@ -300,6 +300,14 @@ gfx::Size FindBarView::CalculatePreferredSize() const { ...@@ -300,6 +300,14 @@ gfx::Size FindBarView::CalculatePreferredSize() const {
return size; return size;
} }
void FindBarView::AddedToWidget() {
// Since the find bar now works/looks like a location bar bubble, make sure it
// doesn't get dark themed in incognito mode.
if (find_bar_host_->browser_view()->browser()->profile()->GetProfileType() ==
Profile::INCOGNITO_PROFILE)
SetNativeTheme(ui::NativeTheme::GetInstanceForNativeUi());
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// FindBarView, DropdownBarHostDelegate implementation: // FindBarView, DropdownBarHostDelegate implementation:
......
...@@ -88,6 +88,10 @@ class FindBarView : public views::View, ...@@ -88,6 +88,10 @@ class FindBarView : public views::View,
// views::ViewTargeterDelegate: // views::ViewTargeterDelegate:
views::View* TargetForRect(View* root, const gfx::Rect& rect) override; views::View* TargetForRect(View* root, const gfx::Rect& rect) override;
protected:
// views::View overrides:
void AddedToWidget() override;
private: private:
// Starts finding |search_text|. If the text is empty, stops finding. // Starts finding |search_text|. If the text is empty, stops finding.
void Find(const base::string16& search_text); void Find(const base::string16& search_text);
......
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