Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/location_icon_view.cc |
| diff --git a/chrome/browser/ui/views/location_bar/location_icon_view.cc b/chrome/browser/ui/views/location_bar/location_icon_view.cc |
| index 78af5ff7df46b6f6106bdf55713bdb1ad2a0d0db..3cbd2169f661a886f95347fa36a1e061b3db1eda 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_icon_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_icon_view.cc |
| @@ -6,11 +6,13 @@ |
| #include "base/strings/utf_string_conversions.h" |
| #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| +#include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h" |
| #include "chrome/grit/generated_resources.h" |
| #include "ui/base/l10n/l10n_util.h" |
| LocationIconView::LocationIconView(LocationBarView* location_bar) |
| - : page_info_helper_(this, location_bar) { |
| + : suppress_mouse_released_action_(false), |
| + page_info_helper_(this, location_bar) { |
| SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON)); |
| } |
| @@ -30,6 +32,8 @@ bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { |
| model->PasteAndGo(text); |
| } |
| + // If the bubble is showing then don't reshow it when the mouse is released. |
| + suppress_mouse_released_action_ = WebsiteSettingsPopupView::IsPopupShowing(); |
| // Showing the bubble on mouse release is standard button behavior. |
| return true; |
|
Peter Kasting
2014/09/17 20:51:42
Nit: I'd just eliminate both comments here. I don
Gaja
2014/09/18 02:51:39
Done.
|
| } |
| @@ -37,6 +41,14 @@ bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { |
| void LocationIconView::OnMouseReleased(const ui::MouseEvent& event) { |
| if (event.IsOnlyMiddleMouseButton()) |
| return; |
| + // If this is the second click on this view then the bubble was showing on |
|
Peter Kasting
2014/09/17 20:51:42
Nit: Blank line above this
Gaja
2014/09/18 02:51:39
Done.
|
| + // the mouse pressed event and is hidden now. Prevent the bubble from |
| + // reshowing by doing nothing here. |
| + if (suppress_mouse_released_action_) { |
| + suppress_mouse_released_action_ = false; |
| + return; |
| + } |
| + |
| OnClickOrTap(event); |
| } |