Commit 9204d725 authored by Allen Bauer's avatar Allen Bauer Committed by Commit Bot

Remove BrowserNonClientView::GetThemeProviderForProfile and just use GetThemeProvider.

Change-Id: I9c458a7fe05c2ed60c1f9498dd0cea3cc3237455
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2019923
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735051}
parent 0f343f65
...@@ -150,7 +150,7 @@ SkColor BrowserNonClientFrameView::GetFrameColor( ...@@ -150,7 +150,7 @@ SkColor BrowserNonClientFrameView::GetFrameColor(
: ThemeProperties::COLOR_FRAME_INACTIVE; : ThemeProperties::COLOR_FRAME_INACTIVE;
if (frame_->ShouldUseTheme()) if (frame_->ShouldUseTheme())
return GetThemeProviderForProfile()->GetColor(color_id); return GetThemeProvider()->GetColor(color_id);
// Use app theme color if it is set, but not for apps with tabs. // Use app theme color if it is set, but not for apps with tabs.
web_app::AppBrowserController* app_controller = web_app::AppBrowserController* app_controller =
...@@ -253,7 +253,7 @@ bool BrowserNonClientFrameView::ShouldPaintAsActive( ...@@ -253,7 +253,7 @@ bool BrowserNonClientFrameView::ShouldPaintAsActive(
gfx::ImageSkia BrowserNonClientFrameView::GetFrameImage( gfx::ImageSkia BrowserNonClientFrameView::GetFrameImage(
BrowserFrameActiveState active_state) const { BrowserFrameActiveState active_state) const {
const ui::ThemeProvider* tp = GetThemeProviderForProfile(); const ui::ThemeProvider* tp = GetThemeProvider();
const int frame_image_id = ShouldPaintAsActive(active_state) const int frame_image_id = ShouldPaintAsActive(active_state)
? IDR_THEME_FRAME ? IDR_THEME_FRAME
: IDR_THEME_FRAME_INACTIVE; : IDR_THEME_FRAME_INACTIVE;
...@@ -268,7 +268,7 @@ gfx::ImageSkia BrowserNonClientFrameView::GetFrameOverlayImage( ...@@ -268,7 +268,7 @@ gfx::ImageSkia BrowserNonClientFrameView::GetFrameOverlayImage(
if (browser_view_->IsIncognito() || !browser_view_->IsBrowserTypeNormal()) if (browser_view_->IsIncognito() || !browser_view_->IsBrowserTypeNormal())
return gfx::ImageSkia(); return gfx::ImageSkia();
const ui::ThemeProvider* tp = GetThemeProviderForProfile(); const ui::ThemeProvider* tp = GetThemeProvider();
const int frame_overlay_image_id = ShouldPaintAsActive(active_state) const int frame_overlay_image_id = ShouldPaintAsActive(active_state)
? IDR_THEME_FRAME_OVERLAY ? IDR_THEME_FRAME_OVERLAY
: IDR_THEME_FRAME_OVERLAY_INACTIVE; : IDR_THEME_FRAME_OVERLAY_INACTIVE;
...@@ -387,13 +387,6 @@ int BrowserNonClientFrameView::GetSystemMenuY() const { ...@@ -387,13 +387,6 @@ int BrowserNonClientFrameView::GetSystemMenuY() const {
} }
#endif #endif
const ui::ThemeProvider*
BrowserNonClientFrameView::GetThemeProviderForProfile() const {
// Because the frame's accessor reads the ThemeProvider from the profile and
// not the widget, it can be called even before we're in a view hierarchy.
return frame_->GetThemeProvider();
}
SkColor BrowserNonClientFrameView::GetThemeOrDefaultColor(int color_id) const { SkColor BrowserNonClientFrameView::GetThemeOrDefaultColor(int color_id) const {
if (!frame_->ShouldUseTheme()) if (!frame_->ShouldUseTheme())
return GetUnthemedColor(color_id); return GetUnthemedColor(color_id);
......
...@@ -177,10 +177,6 @@ class BrowserNonClientFrameView : public views::NonClientFrameView, ...@@ -177,10 +177,6 @@ class BrowserNonClientFrameView : public views::NonClientFrameView,
int GetSystemMenuY() const override; int GetSystemMenuY() const override;
#endif #endif
// Gets a theme provider that should be non-null even before we're added to a
// view hierarchy.
const ui::ThemeProvider* GetThemeProviderForProfile() const;
// Returns the color of the given |color_id| from the theme provider or the // Returns the color of the given |color_id| from the theme provider or the
// default theme properties. // default theme properties.
SkColor GetThemeOrDefaultColor(int color_id) const; SkColor GetThemeOrDefaultColor(int color_id) const;
......
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