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

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

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refinements, etc. Created 9 years, 9 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
Index: views/controls/button/image_button.cc
diff --git a/views/controls/button/image_button.cc b/views/controls/button/image_button.cc
index 612ce8832f48419bfc59607698e30e8430aa47a6..7b35a46e6cf746349794d17e9b5a866174ee13e0 100644
--- a/views/controls/button/image_button.cc
+++ b/views/controls/button/image_button.cc
@@ -64,6 +64,25 @@ gfx::Size ImageButton::GetPreferredSize() {
return preferred_size_;
}
+////////////////////////////////////////////////////////////////////////////////
+// ImageButton, protected:
+
+SkBitmap ImageButton::GetImageToPaint() {
+ SkBitmap img;
+
+ if (!images_[BS_HOT].isNull() && hover_animation_->is_animating()) {
+ img = SkBitmapOperations::CreateBlendedBitmap(images_[BS_NORMAL],
+ images_[BS_HOT], hover_animation_->GetCurrentValue());
+ } else {
+ img = images_[state_];
+ }
+
+ return !img.isNull() ? img : images_[BS_NORMAL];
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// ImageButton, View overrides, protected:
+
void ImageButton::OnPaint(gfx::Canvas* canvas) {
// Call the base class first to paint any background/borders.
View::OnPaint(canvas);
@@ -91,22 +110,6 @@ void ImageButton::OnPaint(gfx::Canvas* canvas) {
}
////////////////////////////////////////////////////////////////////////////////
-// ImageButton, protected:
-
-SkBitmap ImageButton::GetImageToPaint() {
- SkBitmap img;
-
- if (!images_[BS_HOT].isNull() && hover_animation_->is_animating()) {
- img = SkBitmapOperations::CreateBlendedBitmap(images_[BS_NORMAL],
- images_[BS_HOT], hover_animation_->GetCurrentValue());
- } else {
- img = images_[state_];
- }
-
- return !img.isNull() ? img : images_[BS_NORMAL];
-}
-
-////////////////////////////////////////////////////////////////////////////////
// ToggleImageButton, public:
ToggleImageButton::ToggleImageButton(ButtonListener* listener)

Powered by Google App Engine
This is Rietveld 408576698