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" |
11 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h" | 11 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h" |
12 #include "ui/base/models/menu_model.h" | 12 #include "ui/base/models/menu_model.h" |
13 #include "ui/gfx/image/image_skia.h" | 13 #include "ui/gfx/image/image_skia.h" |
14 | 14 |
| 15 G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
| 16 |
15 namespace libgtk2ui { | 17 namespace libgtk2ui { |
16 | 18 |
17 Gtk2StatusIcon::Gtk2StatusIcon(const gfx::ImageSkia& image, | 19 Gtk2StatusIcon::Gtk2StatusIcon(const gfx::ImageSkia& image, |
18 const base::string16& tool_tip) { | 20 const base::string16& tool_tip) { |
19 GdkPixbuf* pixbuf = GdkPixbufFromSkBitmap(*image.bitmap()); | 21 GdkPixbuf* pixbuf = GdkPixbufFromSkBitmap(*image.bitmap()); |
20 gtk_status_icon_ = gtk_status_icon_new_from_pixbuf(pixbuf); | 22 gtk_status_icon_ = gtk_status_icon_new_from_pixbuf(pixbuf); |
21 g_object_unref(pixbuf); | 23 g_object_unref(pixbuf); |
22 | 24 |
23 g_signal_connect(gtk_status_icon_, "activate", G_CALLBACK(OnClickThunk), | 25 g_signal_connect(gtk_status_icon_, "activate", G_CALLBACK(OnClickThunk), |
24 this); | 26 this); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 NULL, | 69 NULL, |
68 NULL, | 70 NULL, |
69 gtk_status_icon_position_menu, | 71 gtk_status_icon_position_menu, |
70 gtk_status_icon_, | 72 gtk_status_icon_, |
71 button, | 73 button, |
72 activate_time); | 74 activate_time); |
73 } | 75 } |
74 } | 76 } |
75 | 77 |
76 } // namespace libgtk2ui | 78 } // namespace libgtk2ui |
OLD | NEW |