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

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

Issue 1534303002: CustomButton cleanup: make protected members private, create accessors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy up Created 5 years 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
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 5b504d4ad764cbad099d4b1b1cd90cf2503618ef..6a58a44e38bd4bb8ba8a04df56d59422090aa831 100644
--- a/ui/views/controls/scrollbar/native_scroll_bar_views.cc
+++ b/ui/views/controls/scrollbar/native_scroll_bar_views.cc
@@ -96,7 +96,7 @@ ui::NativeTheme::ExtraParams
ScrollBarButton::GetNativeThemeParams() const {
ui::NativeTheme::ExtraParams params;
- switch (state_) {
+ switch (state()) {
case CustomButton::STATE_HOVERED:
params.scrollbar_arrow.is_hovering = true;
break;
@@ -126,25 +126,17 @@ ui::NativeTheme::Part
ui::NativeTheme::State
ScrollBarButton::GetNativeThemeState() const {
- ui::NativeTheme::State state;
-
- switch (state_) {
+ switch (state()) {
case CustomButton::STATE_HOVERED:
- state = ui::NativeTheme::kHovered;
- break;
+ return ui::NativeTheme::kHovered;
case CustomButton::STATE_PRESSED:
- state = ui::NativeTheme::kPressed;
- break;
+ return ui::NativeTheme::kPressed;
case CustomButton::STATE_DISABLED:
- state = ui::NativeTheme::kDisabled;
- break;
+ return ui::NativeTheme::kDisabled;
case CustomButton::STATE_NORMAL:
default:
- state = ui::NativeTheme::kNormal;
- break;
+ return ui::NativeTheme::kNormal;
}
-
- return state;
}
/////////////////////////////////////////////////////////////////////////////
@@ -197,25 +189,17 @@ ui::NativeTheme::Part ScrollBarThumb::GetNativeThemePart() const {
}
ui::NativeTheme::State ScrollBarThumb::GetNativeThemeState() const {
- ui::NativeTheme::State state;
-
switch (GetState()) {
case CustomButton::STATE_HOVERED:
- state = ui::NativeTheme::kHovered;
- break;
+ return ui::NativeTheme::kHovered;
case CustomButton::STATE_PRESSED:
- state = ui::NativeTheme::kPressed;
- break;
+ return ui::NativeTheme::kPressed;
case CustomButton::STATE_DISABLED:
- state = ui::NativeTheme::kDisabled;
- break;
+ return ui::NativeTheme::kDisabled;
case CustomButton::STATE_NORMAL:
default:
sadrul 2015/12/21 22:05:32 Maybe remove default, and add a NOTREACHED() for S
Evan Stade 2015/12/21 22:27:16 Done.
- state = ui::NativeTheme::kNormal;
- break;
+ return ui::NativeTheme::kNormal;
}
-
- return state;
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698