| Index: ui/views/controls/button/menu_button.cc
|
| diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc
|
| index 29271cea51f3d5d9f9ac96ae61759a2452267a07..dcfed7ee0f138d102be6150909cb8a4a4e01e193 100644
|
| --- a/ui/views/controls/button/menu_button.cc
|
| +++ b/ui/views/controls/button/menu_button.cc
|
| @@ -16,7 +16,6 @@
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/image/image.h"
|
| #include "ui/gfx/screen.h"
|
| -#include "ui/gfx/text_constants.h"
|
| #include "ui/views/controls/button/button.h"
|
| #include "ui/views/controls/button/menu_button_listener.h"
|
| #include "ui/views/mouse_constants.h"
|
| @@ -47,7 +46,7 @@
|
| const base::string16& text,
|
| MenuButtonListener* menu_button_listener,
|
| bool show_menu_marker)
|
| - : LabelButton(listener, text),
|
| + : TextButton(listener, text),
|
| menu_visible_(false),
|
| menu_offset_(kDefaultMenuOffsetX, kDefaultMenuOffsetY),
|
| listener_(menu_button_listener),
|
| @@ -55,7 +54,7 @@
|
| menu_marker_(ui::ResourceBundle::GetSharedInstance().GetImageNamed(
|
| IDR_MENU_DROPARROW).ToImageSkia()),
|
| destroyed_flag_(NULL) {
|
| - SetHorizontalAlignment(gfx::ALIGN_LEFT);
|
| + set_alignment(TextButton::ALIGN_LEFT);
|
| }
|
|
|
| MenuButton::~MenuButton() {
|
| @@ -134,8 +133,8 @@
|
| return true;
|
| }
|
|
|
| -void MenuButton::OnPaint(gfx::Canvas* canvas) {
|
| - LabelButton::OnPaint(canvas);
|
| +void MenuButton::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
|
| + TextButton::PaintButton(canvas, mode);
|
|
|
| if (show_menu_marker_)
|
| PaintMenuMarker(canvas);
|
| @@ -148,7 +147,7 @@
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|
| gfx::Size MenuButton::GetPreferredSize() const {
|
| - gfx::Size prefsize = LabelButton::GetPreferredSize();
|
| + gfx::Size prefsize = TextButton::GetPreferredSize();
|
| if (show_menu_marker_) {
|
| prefsize.Enlarge(menu_marker_->width() + kMenuMarkerPaddingLeft +
|
| kMenuMarkerPaddingRight,
|
| @@ -187,7 +186,7 @@
|
| HitTestPoint(event.location())) {
|
| Activate();
|
| } else {
|
| - LabelButton::OnMouseReleased(event);
|
| + TextButton::OnMouseReleased(event);
|
| }
|
| }
|
|
|
| @@ -210,7 +209,7 @@
|
| // the gesture event here.
|
| return;
|
| }
|
| - LabelButton::OnGestureEvent(event);
|
| + TextButton::OnGestureEvent(event);
|
| }
|
|
|
| bool MenuButton::OnKeyPressed(const ui::KeyEvent& event) {
|
| @@ -266,17 +265,6 @@
|
| canvas->DrawImageInt(*menu_marker_, arrow_bounds.x(), arrow_bounds.y());
|
| }
|
|
|
| -gfx::Rect MenuButton::GetChildAreaBounds() {
|
| - gfx::Size s = size();
|
| -
|
| - if (show_menu_marker_) {
|
| - s.set_width(s.width() - menu_marker_->width() - kMenuMarkerPaddingLeft -
|
| - kMenuMarkerPaddingRight);
|
| - }
|
| -
|
| - return gfx::Rect(s);
|
| -}
|
| -
|
| int MenuButton::GetMaximumScreenXCoordinate() {
|
| if (!GetWidget()) {
|
| NOTREACHED();
|
|
|