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

Unified Diff: views/controls/button/custom_button.cc

Issue 251099: Refactor cros library code into central location and have the UI elements obs... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « views/controls/button/custom_button.h ('k') | views/controls/button/text_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/button/custom_button.cc
===================================================================
--- views/controls/button/custom_button.cc (revision 28124)
+++ views/controls/button/custom_button.cc (working copy)
@@ -19,7 +19,7 @@
}
void CustomButton::SetState(ButtonState state) {
- if (state != state_) {
+ if (show_highlighted_ && state != state_) {
if (animate_on_state_change_ || !hover_animation_->IsAnimating()) {
animate_on_state_change_ = true;
if (state_ == BS_NORMAL && state == BS_HOT) {
@@ -48,6 +48,10 @@
hover_animation_->SetSlideDuration(duration);
}
+void CustomButton::SetShowHighlighted(bool show_highlighted) {
+ show_highlighted_ = show_highlighted;
+}
+
////////////////////////////////////////////////////////////////////////////////
// CustomButton, View overrides:
@@ -74,6 +78,7 @@
: Button(listener),
state_(BS_NORMAL),
animate_on_state_change_(true),
+ show_highlighted_(true),
triggerable_event_flags_(MouseEvent::EF_LEFT_BUTTON_DOWN) {
hover_animation_.reset(new ThrobAnimation(this));
hover_animation_->SetSlideDuration(kHoverFadeDurationMs);
« no previous file with comments | « views/controls/button/custom_button.h ('k') | views/controls/button/text_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698