Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/action_box_button_view.cc |
| diff --git a/chrome/browser/ui/views/location_bar/action_box_button_view.cc b/chrome/browser/ui/views/location_bar/action_box_button_view.cc |
| index 3e46328cb6e67e1824cf4a38c1a280fa6b980577..4e8e4b79b8362370957a617febee0e2c0286c681 100644 |
| --- a/chrome/browser/ui/views/location_bar/action_box_button_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/action_box_button_view.cc |
| @@ -15,6 +15,13 @@ |
| #include "ui/base/accessibility/accessible_view_state.h" |
| #include "ui/base/l10n/l10n_util.h" |
| #include "ui/base/resource/resource_bundle.h" |
| +#include "ui/gfx/path.h" |
| + |
| + |
| +// static |
| +const int ActionBoxButtonView::kTopBorderOverlapThickness = 1; |
| +const int ActionBoxButtonView::kBottomBorderOverlapThickness = 2; |
| + |
| ActionBoxButtonView::ActionBoxButtonView(Browser* browser, |
| const gfx::Point& menu_offset) |
| @@ -48,6 +55,18 @@ void ActionBoxButtonView::OnMenuButtonClicked(View* source, |
| controller_.OnButtonClicked(); |
| } |
| +bool ActionBoxButtonView::HasHitTestMask() const { |
| + return true; |
| +} |
| + |
| +void ActionBoxButtonView::GetHitTestMask(gfx::Path* mask) const { |
| + SkRect clickable_rect; |
| + clickable_rect.iset(0, kTopBorderOverlapThickness, width(), |
| + height() - kBottomBorderOverlapThickness - |
| + kTopBorderOverlapThickness + 1); |
|
Peter Kasting
2012/10/12 00:32:15
Why do we need the +1? Shouldn't height() already
yefimt
2012/10/12 17:10:44
The reason transparent pixels are included into im
Peter Kasting
2012/10/12 17:36:20
Why isn't the internal height exactly 2x? Is that
yefimt
2012/10/12 17:43:17
In 200% mode, size of the control doubles but bord
|
| + mask->addRect(clickable_rect); |
| +} |
| + |
| void ActionBoxButtonView::ShowMenu(scoped_ptr<ActionBoxMenuModel> menu_model) { |
| menu_ = ActionBoxMenu::Create(browser_, menu_model.Pass()); |
| menu_->RunMenu(this, menu_offset_); |