Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2953)

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h

Issue 2061523002: Enable the translate bubble to be dismissed when user ignores it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h
diff --git a/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h b/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h
index c9b8fa6e991832f681ca9d0aa5c345dc45791834..c83cd4314e09be680995ac25bf090640ef2e58f3 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h
+++ b/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h
@@ -9,6 +9,7 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/views/bubble/bubble_dialog_delegate.h"
+#include "ui/views/event_monitor.h"
namespace content {
class NotificationDetails;
@@ -49,6 +50,27 @@ class LocationBarBubbleDelegateView : public views::BubbleDialogDelegateView,
const content::NotificationDetails& details) override;
protected:
+ // The class listens for WebContentsView events and closes the bubble. Useful
+ // for bubbles that do not start out focused but need to close when the user
+ // interacts with the web view.
+ class WebContentMouseHandler : public ui::EventHandler {
+ public:
+ WebContentMouseHandler(LocationBarBubbleDelegateView* bubble,
+ content::WebContents* web_contents);
+ ~WebContentMouseHandler() override;
+
+ void OnKeyEvent(ui::KeyEvent* event) override;
+ void OnMouseEvent(ui::MouseEvent* event) override;
+ void OnTouchEvent(ui::TouchEvent* event) override;
+
+ private:
+ LocationBarBubbleDelegateView* bubble_;
+ content::WebContents* web_contents_;
+ std::unique_ptr<views::EventMonitor> event_monitor_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebContentMouseHandler);
+ };
+
// Closes the bubble.
virtual void CloseBubble();
« no previous file with comments | « no previous file | chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698