Commit 7ab72164 authored by tfarina@chromium.org's avatar tfarina@chromium.org

views: Use NOTREACHED() where appropriate.

R=sky@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10103019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132586 0039d316-1c4b-4281-b951-d872f2087c98
parent bcf6762f
...@@ -366,7 +366,7 @@ void NativeThemeWin::Paint(SkCanvas* canvas, ...@@ -366,7 +366,7 @@ void NativeThemeWin::Paint(SkCanvas* canvas,
default: default:
// While transitioning NativeThemeWin to the single Paint() entry point, // While transitioning NativeThemeWin to the single Paint() entry point,
// unsupported parts will DCHECK here. // unsupported parts will DCHECK here.
DCHECK(false); NOTREACHED();
} }
} }
......
...@@ -63,29 +63,32 @@ ExampleNativeThemeButton::~ExampleNativeThemeButton() { ...@@ -63,29 +63,32 @@ ExampleNativeThemeButton::~ExampleNativeThemeButton() {
std::string ExampleNativeThemeButton::MessWithState() { std::string ExampleNativeThemeButton::MessWithState() {
const char* message = NULL; const char* message = NULL;
switch (GetThemePart()) { switch (GetThemePart()) {
case gfx::NativeTheme::kPushButton: case gfx::NativeTheme::kPushButton:
message = "Pressed! count:%d"; message = "Pressed! count:%d";
break; break;
case gfx::NativeTheme::kRadio: case gfx::NativeTheme::kRadio:
is_checked_ = !is_checked_; is_checked_ = !is_checked_;
message = is_checked_ ? "Checked! count:%d" : "Unchecked! count:%d"; message = is_checked_ ? "Checked! count:%d" : "Unchecked! count:%d";
break; break;
case gfx::NativeTheme::kCheckbox: case gfx::NativeTheme::kCheckbox:
if (is_indeterminate_) { if (is_indeterminate_) {
is_checked_ = false; is_checked_ = false;
is_indeterminate_ = false; is_indeterminate_ = false;
} else if (!is_checked_) { } else if (!is_checked_) {
is_checked_ = true; is_checked_ = true;
} else { } else {
is_checked_ = false; is_checked_ = false;
is_indeterminate_ = true; is_indeterminate_ = true;
} }
if (is_checked_)
message = is_checked_ ? "Checked! count:%d" : message = "Checked! count:%d";
is_indeterminate_ ? "Indeterminate! count:%d" : "Unchecked! count:%d"; else if (is_indeterminate_)
break; message = "Indeterminate! count:%d";
default: else
DCHECK(false); message = "Unchecked! count:%d";
break;
default:
NOTREACHED();
} }
return base::StringPrintf(message, ++count_); return base::StringPrintf(message, ++count_);
...@@ -104,7 +107,7 @@ gfx::NativeTheme::Part ExampleNativeThemeButton::GetThemePart() const { ...@@ -104,7 +107,7 @@ gfx::NativeTheme::Part ExampleNativeThemeButton::GetThemePart() const {
case 2: case 2:
return gfx::NativeTheme::kCheckbox; return gfx::NativeTheme::kCheckbox;
default: default:
DCHECK(false); NOTREACHED();
} }
return gfx::NativeTheme::kPushButton; return gfx::NativeTheme::kPushButton;
} }
...@@ -136,7 +139,7 @@ gfx::NativeTheme::State ExampleNativeThemeButton::GetThemeState( ...@@ -136,7 +139,7 @@ gfx::NativeTheme::State ExampleNativeThemeButton::GetThemeState(
case BS_PUSHED: case BS_PUSHED:
return gfx::NativeTheme::kPressed; return gfx::NativeTheme::kPressed;
default: default:
DCHECK(false); NOTREACHED();
} }
} }
...@@ -150,7 +153,7 @@ gfx::NativeTheme::State ExampleNativeThemeButton::GetThemeState( ...@@ -150,7 +153,7 @@ gfx::NativeTheme::State ExampleNativeThemeButton::GetThemeState(
case 3: case 3:
return gfx::NativeTheme::kPressed; return gfx::NativeTheme::kPressed;
default: default:
DCHECK(false); NOTREACHED();
} }
return gfx::NativeTheme::kNormal; return gfx::NativeTheme::kNormal;
} }
......
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