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..03085150918211ddcde0f8385aaea55983a0df22 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,17 @@ |
| #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" |
| + |
| + |
| +// Thickness of the top transparent area on a button image that overlaps |
| +// location bar border. |
|
Peter Kasting
2012/10/13 00:25:29
Nit: Don't repeat this comment
yefimt
2012/10/13 00:51:30
Done.
|
| +// static |
| +const int ActionBoxButtonView::kTopBorderOverlapThickness = 2; |
| + |
| +// Thickness of the bottom transparent area on a button image that overlaps |
| +// location bar border. |
| +const int kBottomBorderOverlapThickness = 2; |
|
Peter Kasting
2012/10/13 00:25:29
Nit: Eliminate this constant and rename the other
yefimt
2012/10/13 00:51:30
Done.
|
| ActionBoxButtonView::ActionBoxButtonView(Browser* browser, |
| const gfx::Point& menu_offset) |
| @@ -48,6 +59,17 @@ 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); |
| + mask->addRect(clickable_rect); |
| +} |
| + |
| void ActionBoxButtonView::ShowMenu(scoped_ptr<ActionBoxMenuModel> menu_model) { |
| menu_ = ActionBoxMenu::Create(browser_, menu_model.Pass()); |
| menu_->RunMenu(this, menu_offset_); |