| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/libgtk2ui/gtk2_status_icon.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_status_icon.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/libgtk2ui/app_indicator_icon_menu.h" | 10 #include "chrome/browser/ui/libgtk2ui/app_indicator_icon_menu.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 Gtk2StatusIcon::~Gtk2StatusIcon() { | 30 Gtk2StatusIcon::~Gtk2StatusIcon() { |
| 31 g_object_unref(gtk_status_icon_); | 31 g_object_unref(gtk_status_icon_); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void Gtk2StatusIcon::SetImage(const gfx::ImageSkia& image) { | 34 void Gtk2StatusIcon::SetImage(const gfx::ImageSkia& image) { |
| 35 GdkPixbuf* pixbuf = GdkPixbufFromSkBitmap(*image.bitmap()); | 35 GdkPixbuf* pixbuf = GdkPixbufFromSkBitmap(*image.bitmap()); |
| 36 gtk_status_icon_set_from_pixbuf(gtk_status_icon_, pixbuf); | 36 gtk_status_icon_set_from_pixbuf(gtk_status_icon_, pixbuf); |
| 37 g_object_unref(pixbuf); | 37 g_object_unref(pixbuf); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void Gtk2StatusIcon::SetPressedImage(const gfx::ImageSkia& image) { | |
| 41 // Ignore pressed images, since the standard on Linux is to not highlight | |
| 42 // pressed status icons. | |
| 43 } | |
| 44 | |
| 45 void Gtk2StatusIcon::SetToolTip(const base::string16& tool_tip) { | 40 void Gtk2StatusIcon::SetToolTip(const base::string16& tool_tip) { |
| 46 gtk_status_icon_set_tooltip_text(gtk_status_icon_, | 41 gtk_status_icon_set_tooltip_text(gtk_status_icon_, |
| 47 base::UTF16ToUTF8(tool_tip).c_str()); | 42 base::UTF16ToUTF8(tool_tip).c_str()); |
| 48 } | 43 } |
| 49 | 44 |
| 50 void Gtk2StatusIcon::UpdatePlatformContextMenu(ui::MenuModel* model) { | 45 void Gtk2StatusIcon::UpdatePlatformContextMenu(ui::MenuModel* model) { |
| 51 menu_.reset(); | 46 menu_.reset(); |
| 52 if (model) | 47 if (model) |
| 53 menu_.reset(new AppIndicatorIconMenu(model)); | 48 menu_.reset(new AppIndicatorIconMenu(model)); |
| 54 } | 49 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 71 NULL, | 66 NULL, |
| 72 NULL, | 67 NULL, |
| 73 gtk_status_icon_position_menu, | 68 gtk_status_icon_position_menu, |
| 74 gtk_status_icon_, | 69 gtk_status_icon_, |
| 75 button, | 70 button, |
| 76 activate_time); | 71 activate_time); |
| 77 } | 72 } |
| 78 } | 73 } |
| 79 | 74 |
| 80 } // namespace libgtk2ui | 75 } // namespace libgtk2ui |
| OLD | NEW |