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

Unified Diff: ui/views/examples/native_theme_button_example.cc

Issue 10103019: views: Use NOTREACHED() where appropriate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « ui/gfx/native_theme_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/native_theme_button_example.cc
diff --git a/ui/views/examples/native_theme_button_example.cc b/ui/views/examples/native_theme_button_example.cc
index c92f1d6f35c59215618ed6932c6085674f993148..c8a5e59e07430f970300b685ee13897048bd7bb5 100644
--- a/ui/views/examples/native_theme_button_example.cc
+++ b/ui/views/examples/native_theme_button_example.cc
@@ -63,29 +63,32 @@ ExampleNativeThemeButton::~ExampleNativeThemeButton() {
std::string ExampleNativeThemeButton::MessWithState() {
const char* message = NULL;
switch (GetThemePart()) {
- case gfx::NativeTheme::kPushButton:
- message = "Pressed! count:%d";
- break;
- case gfx::NativeTheme::kRadio:
- is_checked_ = !is_checked_;
- message = is_checked_ ? "Checked! count:%d" : "Unchecked! count:%d";
- break;
- case gfx::NativeTheme::kCheckbox:
- if (is_indeterminate_) {
- is_checked_ = false;
- is_indeterminate_ = false;
- } else if (!is_checked_) {
- is_checked_ = true;
- } else {
- is_checked_ = false;
- is_indeterminate_ = true;
- }
-
- message = is_checked_ ? "Checked! count:%d" :
- is_indeterminate_ ? "Indeterminate! count:%d" : "Unchecked! count:%d";
- break;
- default:
- DCHECK(false);
+ case gfx::NativeTheme::kPushButton:
+ message = "Pressed! count:%d";
+ break;
+ case gfx::NativeTheme::kRadio:
+ is_checked_ = !is_checked_;
+ message = is_checked_ ? "Checked! count:%d" : "Unchecked! count:%d";
+ break;
+ case gfx::NativeTheme::kCheckbox:
+ if (is_indeterminate_) {
+ is_checked_ = false;
+ is_indeterminate_ = false;
+ } else if (!is_checked_) {
+ is_checked_ = true;
+ } else {
+ is_checked_ = false;
+ is_indeterminate_ = true;
+ }
+ if (is_checked_)
+ message = "Checked! count:%d";
+ else if (is_indeterminate_)
+ message = "Indeterminate! count:%d";
+ else
+ message = "Unchecked! count:%d";
+ break;
+ default:
+ NOTREACHED();
}
return base::StringPrintf(message, ++count_);
@@ -104,7 +107,7 @@ gfx::NativeTheme::Part ExampleNativeThemeButton::GetThemePart() const {
case 2:
return gfx::NativeTheme::kCheckbox;
default:
- DCHECK(false);
+ NOTREACHED();
}
return gfx::NativeTheme::kPushButton;
}
@@ -136,7 +139,7 @@ gfx::NativeTheme::State ExampleNativeThemeButton::GetThemeState(
case BS_PUSHED:
return gfx::NativeTheme::kPressed;
default:
- DCHECK(false);
+ NOTREACHED();
}
}
@@ -150,7 +153,7 @@ gfx::NativeTheme::State ExampleNativeThemeButton::GetThemeState(
case 3:
return gfx::NativeTheme::kPressed;
default:
- DCHECK(false);
+ NOTREACHED();
}
return gfx::NativeTheme::kNormal;
}
« no previous file with comments | « ui/gfx/native_theme_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698