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

Unified Diff: ui/views/controls/scrollbar/native_scroll_bar_views.cc

Issue 12212144: Add NULL check for NativeTheme in scrollbar methods. A NULL theme can (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/scrollbar/native_scroll_bar_views.cc
diff --git a/ui/views/controls/scrollbar/native_scroll_bar_views.cc b/ui/views/controls/scrollbar/native_scroll_bar_views.cc
index 06e96a2e23d0510019b58deaf1e3e04373430eda..f9ac51ca64e79e068fe024ec4541156336c0e72f 100644
--- a/ui/views/controls/scrollbar/native_scroll_bar_views.cc
+++ b/ui/views/controls/scrollbar/native_scroll_bar_views.cc
@@ -382,6 +382,8 @@ NativeScrollBarWrapper* NativeScrollBarWrapper::CreateWrapper(
// static
int NativeScrollBarWrapper::GetHorizontalScrollBarHeight(
const ui::NativeTheme* theme) {
+ if (!theme)
+ theme = ui::NativeTheme::instance();
ui::NativeTheme::ExtraParams button_params;
button_params.scrollbar_arrow.is_hovering = false;
gfx::Size button_size = theme->GetPartSize(
@@ -402,6 +404,8 @@ int NativeScrollBarWrapper::GetHorizontalScrollBarHeight(
// static
int NativeScrollBarWrapper::GetVerticalScrollBarWidth(
const ui::NativeTheme* theme) {
+ if (!theme)
+ theme = ui::NativeTheme::instance();
ui::NativeTheme::ExtraParams button_params;
button_params.scrollbar_arrow.is_hovering = false;
gfx::Size button_size = theme->GetPartSize(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698