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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_util.h

Issue 18334003: Linux status icon for Ubuntu Unity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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/libgtk2ui/gtk2_util.h
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_util.h b/chrome/browser/ui/libgtk2ui/gtk2_util.h
index 77a1cbf7bee0ffebda3659af14e23bda778c319e..705761f0a15949e673cc5d1ceb8c69427ba499d4 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_util.h
+++ b/chrome/browser/ui/libgtk2ui/gtk2_util.h
@@ -5,10 +5,9 @@
#ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_
#define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_
+#include <gtk/gtk.h>
#include <string>
-typedef struct _GdkPixbuf GdkPixbuf;
-
class CommandLine;
class SkBitmap;
@@ -16,6 +15,10 @@ namespace base {
class Environment;
}
+namespace ui {
+class Accelerator;
+}
+
namespace libgtk2ui {
void GtkInitFromCommandLine(const CommandLine& command_line);
@@ -25,6 +28,28 @@ std::string GetDesktopName(base::Environment* env);
const SkBitmap GdkPixbufToImageSkia(GdkPixbuf* pixbuf);
+// Convert and copy a SkBitmap to a GdkPixbuf. NOTE: this uses BGRAToRGBA, so
+// it is an expensive operation. The returned GdkPixbuf will have a refcount of
+// 1, and the caller is responsible for unrefing it when done.
+GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap);
+
+// Show the image for the given menu item, even if the user's default is to not
+// show images. Only to be used for favicons or other menus where the image is
+// crucial to its functionality.
+void SetAlwaysShowImage(GtkWidget* image_menu_item);
+
+// Change windows accelerator style to GTK style. (GTK uses _ for
+// accelerators. Windows uses & with && as an escape for &.)
+std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label);
+
+guint GetGdkKeyCodeForAccelerator(const ui::Accelerator& accelerator);
+
+GdkModifierType GetGdkModifierForAccelerator(
+ const ui::Accelerator& accelerator);
+
+// Translates event flags into plaform independent event flags.
+int EventFlagsFromGdkState(guint state);
+
} // namespace libgtk2ui
#endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698