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

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

Issue 11262002: Merge TextButton and LabelButton border images util structs, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add friend tests, remove unused variable. Created 8 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
Index: ui/views/controls/button/border_images.h
diff --git a/ui/views/controls/button/border_images.h b/ui/views/controls/button/border_images.h
new file mode 100644
index 0000000000000000000000000000000000000000..517a8cb388d94ace29c14b1be481494c7940abd5
--- /dev/null
+++ b/ui/views/controls/button/border_images.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef UI_VIEWS_CONTROLS_BUTTON_BORDER_IMAGES_H_
+#define UI_VIEWS_CONTROLS_BUTTON_BORDER_IMAGES_H_
+
+#include "ui/gfx/image/image_skia.h"
+#include "ui/views/views_export.h"
+
+namespace gfx {
+class Canvas;
+class Rect;
+}
+
+namespace views {
+
+// BorderImages stores and paints the nine images comprising a button border.
+// TODO(msw): Merge common "nine-box" code with BubbleBorder, ImagePainter, etc.
+// TODO(msw): Stitch border image assets together and use ImagePainter.
+struct VIEWS_EXPORT BorderImages {
+ // The default hot and pushed button image IDs; normal has none by default.
+ static const int kHot[];
+ static const int kPushed[];
+
+ BorderImages();
+ // |image_ids| must contain 9 image IDs matching the member order below.
+ explicit BorderImages(const int image_ids[]);
+ ~BorderImages();
+
+ // Paint the images on |canvas| within |rect|'s dimensions.
+ void Paint(const gfx::Rect& rect, gfx::Canvas* canvas) const;
+
+ gfx::ImageSkia top_left;
+ gfx::ImageSkia top;
+ gfx::ImageSkia top_right;
+ gfx::ImageSkia left;
+ gfx::ImageSkia center;
+ gfx::ImageSkia right;
+ gfx::ImageSkia bottom_left;
+ gfx::ImageSkia bottom;
+ gfx::ImageSkia bottom_right;
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_CONTROLS_BUTTON_BORDER_IMAGES_H_
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_button_border.cc ('k') | ui/views/controls/button/border_images.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698