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

Unified Diff: ui/views/controls/button/image_button.h

Issue 10174014: views: Add optional overlay image to ImageButton (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove debugging tweak Created 8 years, 8 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 | « no previous file | ui/views/controls/button/image_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/image_button.h
diff --git a/ui/views/controls/button/image_button.h b/ui/views/controls/button/image_button.h
index f4260caecd6789fd73d3f12e83f7f0e5a3a27c21..3085869f3712e8b532dff7c5351038070d517255 100644
--- a/ui/views/controls/button/image_button.h
+++ b/ui/views/controls/button/image_button.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,6 +6,7 @@
#define UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_
#pragma once
+#include "base/gtest_prod_util.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/views/controls/button/custom_button.h"
@@ -30,6 +31,10 @@ class VIEWS_EXPORT ImageButton : public CustomButton {
const SkBitmap* image,
const SkBitmap* mask);
+ // Set an |image| to draw on top of the normal / hot / pushed image.
+ // Pass NULL for no image.
+ void SetOverlayImage(const SkBitmap* image);
+
enum HorizontalAlignment { ALIGN_LEFT = 0,
ALIGN_CENTER,
ALIGN_RIGHT, };
@@ -63,7 +68,12 @@ class VIEWS_EXPORT ImageButton : public CustomButton {
// The background image.
SkBitmap background_image_;
+ // Image to draw on top of normal / hot / pushed image. Usually empty.
+ SkBitmap overlay_image_;
+
private:
+ FRIEND_TEST_ALL_PREFIXES(ImageButtonTest, Basics);
+
// Image alignment.
HorizontalAlignment h_alignment_;
VerticalAlignment v_alignment_;
« no previous file with comments | « no previous file | ui/views/controls/button/image_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698