summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc15
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 81b4a3b..1cca1af 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -34,6 +34,8 @@
#include "chrome/browser/ui/bookmarks/bookmark_utils.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
+#include "chrome/browser/ui/omnibox/omnibox_view.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.h"
@@ -669,6 +671,19 @@ gfx::Size BookmarkBarView::GetPreferredSize() {
return LayoutItems(true);
}
+bool BookmarkBarView::HitTestRect(const gfx::Rect& rect) const {
+ // If bookmark bar is attached and omnibox popup is open (on top of the bar),
+ // force hit-testing to fail. This prevents hovers/clicks just above the
+ // omnibox popup from activating the top few pixels of items on the bookmark
+ // bar.
+ if (!IsDetached() && browser_view_ &&
+ browser_view_->GetLocationBar()->GetLocationEntry()->model()->
+ popup_model()->IsOpen()) {
+ return false;
+ }
+ return DetachableToolbarView::HitTestRect(rect);
+}
+
gfx::Size BookmarkBarView::GetMinimumSize() {
// The minimum width of the bookmark bar should at least contain the overflow
// button, by which one can access all the Bookmark Bar items, and the "Other
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
index 72b0e2c..afea414 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
@@ -165,6 +165,7 @@ class BookmarkBarView : public DetachableToolbarView,
// View methods:
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual gfx::Size GetMinimumSize() OVERRIDE;
+ virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE;
virtual void Layout() OVERRIDE;
virtual void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) OVERRIDE;