summaryrefslogtreecommitdiffstats
path: root/ui/views/controls/button/text_button.cc
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-09 18:49:12 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-09 18:49:12 +0000
commitd21d2337d22458957fca372cc321d3175ffd207b (patch)
tree717df6fa72a0d5adf2fa5b88292bcec120d9bf2b /ui/views/controls/button/text_button.cc
parent061b498409adc1ae8e46d2e6554747ec75987b1e (diff)
downloadchromium_src-d21d2337d22458957fca372cc321d3175ffd207b.zip
chromium_src-d21d2337d22458957fca372cc321d3175ffd207b.tar.gz
chromium_src-d21d2337d22458957fca372cc321d3175ffd207b.tar.bz2
Make views::Border::Paint() non-const; additional cleanup.
Make views::Border::Paint() and OVERRIDEs non-const. Make BorderImages::Paint early return if IsEmpty(). Add LabelButtonBorder::GetImages, PaintHelper, refactor. Remove const_casting of BorderImages. Nix unused includes and forward decls in content_setting_image_view.h Nix unused includes in balloon_view_views.cc, tray_details_view.cc Add extra OVERRIDE use and fix comment in chrome_style.cc TODO(followup): Consolidate LabelButtonBorder/NativeThemePainter? BUG=155363 TEST=No behavior changes. R=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11293162 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166941 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls/button/text_button.cc')
-rw-r--r--ui/views/controls/button/text_button.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/ui/views/controls/button/text_button.cc b/ui/views/controls/button/text_button.cc
index 3b122cd..bd576d7 100644
--- a/ui/views/controls/button/text_button.cc
+++ b/ui/views/controls/button/text_button.cc
@@ -98,15 +98,14 @@ TextButtonBorder::~TextButtonBorder() {
// TextButtonBorder - painting
//
////////////////////////////////////////////////////////////////////////////////
-void TextButtonBorder::Paint(const View& view, gfx::Canvas* canvas) const {
+void TextButtonBorder::Paint(const View& view, gfx::Canvas* canvas) {
const TextButton* button = static_cast<const TextButton*>(&view);
int state = button->state();
- BorderImages* set = const_cast<BorderImages*>(&normal_set_);
+ BorderImages* set = &normal_set_;
if (button->show_multiple_icon_states() &&
((state == TextButton::BS_HOT) || (state == TextButton::BS_PUSHED))) {
- set = const_cast<BorderImages*>(
- (state == TextButton::BS_HOT) ? &hot_set_ : &pushed_set_);
+ set = (state == TextButton::BS_HOT) ? &hot_set_ : &pushed_set_;
}
if (!set->IsEmpty()) {
if (button->GetAnimation()->is_animating()) {
@@ -141,8 +140,7 @@ TextButtonNativeThemeBorder::TextButtonNativeThemeBorder(
TextButtonNativeThemeBorder::~TextButtonNativeThemeBorder() {
}
-void TextButtonNativeThemeBorder::Paint(const View& view,
- gfx::Canvas* canvas) const {
+void TextButtonNativeThemeBorder::Paint(const View& view, gfx::Canvas* canvas) {
const ui::NativeTheme* theme = view.GetNativeTheme();
const TextButtonBase* tb = static_cast<const TextButton*>(&view);
ui::NativeTheme::Part part = delegate_->GetThemePart();