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

Unified Diff: chrome/browser/ui/gtk/event_utils.h

Issue 10546116: gtk: Extract event functions into event_utils module. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « chrome/browser/ui/gtk/browser_toolbar_gtk.cc ('k') | chrome/browser/ui/gtk/event_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/event_utils.h
diff --git a/chrome/browser/ui/gtk/event_utils.h b/chrome/browser/ui/gtk/event_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..d71312d411a6dd3a58da5e38e32299f7ea100411
--- /dev/null
+++ b/chrome/browser/ui/gtk/event_utils.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_GTK_EVENT_UTILS_H_
+#define CHROME_BROWSER_UI_GTK_EVENT_UTILS_H_
+#pragma once
+
+#include <gtk/gtk.h>
+
+#include "webkit/glue/window_open_disposition.h"
+
+namespace event_utils {
+
+// Translates event flags into plaform independent event flags.
+int EventFlagsFromGdkState(guint state);
+
+// Translates GdkEvent state into what kind of disposition they represent.
+// For example, a middle click would mean to open a background tab.
+WindowOpenDisposition DispositionFromGdkState(guint state);
+
+// Get the window open disposition from the state in gtk_get_current_event().
+// This is designed to be called inside a "clicked" event handler. It is an
+// error to call it when gtk_get_current_event() won't return a GdkEventButton*.
+WindowOpenDisposition DispositionForCurrentButtonPressEvent();
+
+} // namespace event_utils
+
+#endif // CHROME_BROWSER_UI_GTK_EVENT_UTILS_H_
« no previous file with comments | « chrome/browser/ui/gtk/browser_toolbar_gtk.cc ('k') | chrome/browser/ui/gtk/event_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698