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

Side by Side Diff: views/controls/button/text_button.cc

Issue 6976048: views: Add OnEnabledChanged() method to View class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix DisableOnHover test? Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/button/text_button.h ('k') | views/controls/combobox/combobox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/controls/button/text_button.h" 5 #include "views/controls/button/text_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 } 553 }
554 } 554 }
555 555
556 //////////////////////////////////////////////////////////////////////////////// 556 ////////////////////////////////////////////////////////////////////////////////
557 // TextButtonBase, View overrides: 557 // TextButtonBase, View overrides:
558 558
559 gfx::Size TextButtonBase::GetMinimumSize() { 559 gfx::Size TextButtonBase::GetMinimumSize() {
560 return max_text_size_; 560 return max_text_size_;
561 } 561 }
562 562
563 void TextButtonBase::SetEnabled(bool enabled) { 563 void TextButtonBase::OnEnabledChanged() {
564 if (enabled != IsEnabled()) {
565 CustomButton::SetEnabled(enabled);
566 }
567 // We should always call UpdateColor() since the state of the button might be 564 // We should always call UpdateColor() since the state of the button might be
568 // changed by other functions like CustomButton::SetState(). 565 // changed by other functions like CustomButton::SetState().
569 UpdateColor(); 566 UpdateColor();
570 SchedulePaint(); 567 CustomButton::OnEnabledChanged();
571 } 568 }
572 569
573 std::string TextButtonBase::GetClassName() const { 570 std::string TextButtonBase::GetClassName() const {
574 return kViewClassName; 571 return kViewClassName;
575 } 572 }
576 573
577 //////////////////////////////////////////////////////////////////////////////// 574 ////////////////////////////////////////////////////////////////////////////////
578 // TextButtonBase, NativeThemeDelegate overrides: 575 // TextButtonBase, NativeThemeDelegate overrides:
579 576
580 gfx::Rect TextButtonBase::GetThemePaintRect() const { 577 gfx::Rect TextButtonBase::GetThemePaintRect() const {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 bounds.Inset(0, 0, extra_width, 0); 733 bounds.Inset(0, 0, extra_width, 0);
737 } 734 }
738 } 735 }
739 736
740 return bounds; 737 return bounds;
741 } 738 }
742 739
743 } // namespace views 740 } // namespace views
744 741
745 742
OLDNEW
« no previous file with comments | « views/controls/button/text_button.h ('k') | views/controls/combobox/combobox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698