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

Unified Diff: chrome/browser/ui/views/profile_chooser_view.cc

Issue 81833007: Remove unnecessary Border subclasses where we can achieve the same functionality (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 1 month 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: chrome/browser/ui/views/profile_chooser_view.cc
===================================================================
--- chrome/browser/ui/views/profile_chooser_view.cc (revision 236651)
+++ chrome/browser/ui/views/profile_chooser_view.cc (working copy)
@@ -87,32 +87,6 @@
}
-// HorizontalPaddingButtonBorder ----------------------------------------------
-
-// A button border that adds padding before the icon and after the text. This
-// is needed so that the button looks like it is spanning the entire parent
-// view (especially when hovered over), but has the icon indented and aligned
-// with the other items in the parent view.
-class HorizontalPaddingButtonBorder : public views::TextButtonBorder {
- public:
- HorizontalPaddingButtonBorder() : views::TextButtonBorder() {
- SetInsets(gfx::Insets(0, views::kButtonHEdgeMarginNew,
- 0, views::kButtonHEdgeMarginNew));
- };
-
- virtual ~HorizontalPaddingButtonBorder() {
- };
-
- private:
- // This function is pure virtual in the parent, so we must provide an
- // implementation.
- virtual void Paint(const views::View& view, gfx::Canvas* canvas) OVERRIDE {
- };
-
- DISALLOW_COPY_AND_ASSIGN(HorizontalPaddingButtonBorder);
-};
-
-
// BackgroundColorHoverButton -------------------------------------------------
// A custom button that allows for setting a background color when hovered over.
@@ -140,7 +114,11 @@
const gfx::ImageSkia& normal_icon,
const gfx::ImageSkia& hover_icon)
: views::TextButton(listener, text) {
- set_border(new HorizontalPaddingButtonBorder);
+ scoped_ptr<views::TextButtonBorder> text_button_border(
+ new views::TextButtonBorder());
+ text_button_border->SetInsets(gfx::Insets(0, views::kButtonHEdgeMarginNew,
+ 0, views::kButtonHEdgeMarginNew));
+ set_border(text_button_border.release());
set_min_height(kButtonHeight);
set_icon_text_spacing(views::kItemLabelSpacing);
SetIcon(normal_icon);

Powered by Google App Engine
This is Rietveld 408576698