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

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: dont move declaration randomly 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
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/views.gyp » ('j') | 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 5b504d4ad764cbad099d4b1b1cd90cf2503618ef..3348b5bcbca041cc3e422722b685040a623e0c45 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;
@@ -119,32 +119,29 @@ ui::NativeTheme::Part
return ui::NativeTheme::kScrollbarLeftArrow;
case RIGHT:
return ui::NativeTheme::kScrollbarRightArrow;
- default:
- return ui::NativeTheme::kScrollbarUpArrow;
}
+
+ NOTREACHED();
+ return ui::NativeTheme::kScrollbarUpArrow;
}
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;
+ return ui::NativeTheme::kNormal;
+ case CustomButton::STATE_COUNT:
break;
}
- return state;
+ NOTREACHED();
+ return ui::NativeTheme::kNormal;
}
/////////////////////////////////////////////////////////////////////////////
@@ -197,25 +194,21 @@ 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:
- state = ui::NativeTheme::kNormal;
+ return ui::NativeTheme::kNormal;
+ case CustomButton::STATE_COUNT:
break;
}
- return state;
+ NOTREACHED();
+ return ui::NativeTheme::kNormal;
}
} // namespace
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698