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

Unified Diff: chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc

Issue 8021009: Consolidate message observer API for win and aura (and touch). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
Index: chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
diff --git a/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc b/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
index 5b611bce1ace8be430988e8d2576438d2657ddca..8a76a6065e5ceda6dd2661acfee7dd036f555037 100644
--- a/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
+++ b/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
@@ -47,24 +47,18 @@ const int kSpacerLocationbarOverlap = 1;
// An mouse event observer to detect a mouse click on
// BrowserView's content area and hide the location bar.
-class MouseObserver
-#if !defined(USE_AURA)
- : public MessageLoopForUI::Observer
-#endif
- {
+class MouseObserver : public MessageLoopForUI::Observer {
public:
MouseObserver(CompactLocationBarViewHost* host, BrowserView* view);
~MouseObserver();
// MessageLoopForUI::Observer overrides.
-#if !defined(USE_AURA)
-#if defined(OS_WIN)
- virtual void WillProcessMessage(const MSG& native_event) OVERRIDE;
- virtual void DidProcessMessage(const MSG& native_event) OVERRIDE;
-#elif defined(OS_LINUX)
- virtual void WillProcessEvent(GdkEvent* native_event) OVERRIDE;
- virtual void DidProcessEvent(GdkEvent* native_event) OVERRIDE;
-#endif
+#if defined(OS_WIN) || defined(TOUCH_UI) || defined(USE_AURA)
+ virtual base::EventStatus WillProcessEvent(const base::NativeEvent& event) OVERRIDE;
+ virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE;
+#elif defined(TOOLKIT_USES_GTK)
+ virtual void WillProcessEvent(GdkEvent* event) OVERRIDE;
+ virtual void DidProcessEvent(GdkEvent* event) OVERRIDE;
#endif
void Observe(MessageLoopForUI* loop);
@@ -106,12 +100,24 @@ MouseObserver::~MouseObserver() {
StopObserving(MessageLoopForUI::current());
}
-#if !defined(USE_AURA)
-#if defined(OS_WIN)
-void MouseObserver::WillProcessMessage(const MSG& native_event) {}
-void MouseObserver::DidProcessMessage(const MSG& native_event) {
-#elif defined(OS_LINUX)
+#if defined(OS_WIN) || defined(TOUCH_UI) || defined(USE_AURA)
+base::EventStatus MouseObserver::WillProcessEvent(const base::NativeEvent& native_event) {
+ return base::EVENT_CONTINUE;
+}
+#elif defined(TOOLKIT_USES_GTK)
void MouseObserver::WillProcessEvent(GdkEvent* native_event) {}
+#endif
+
+#if defined(TOUCH_UI) || defined(USE_AURA)
+void MouseObserver::DidProcessEvent(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+}
+
+#else
+
+#if defined(OS_WIN)
+void MouseObserver::DidProcessEvent(const base::NativeEvent& native_event) {
+#elif defined(TOOLKIT_USES_GTK)
void MouseObserver::DidProcessEvent(GdkEvent* native_event) {
#endif
// Hide the location bar iff the mouse is pressed on the
@@ -125,7 +131,8 @@ void MouseObserver::DidProcessEvent(GdkEvent* native_event) {
host_->Hide(true);
}
}
-#endif
+
+#endif // defined(TOUCH_UI) || defiend(USE_AURA)
void MouseObserver::Observe(MessageLoopForUI* loop) {
#if !defined(USE_AURA)

Powered by Google App Engine
This is Rietveld 408576698