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

Side by Side Diff: chrome/browser/ui/libgtk2ui/gtk2_status_icon.cc

Issue 464163003: Remove IDR_STATUS_TRAY_ICON_PRESSED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated the comment Created 6 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_status_icon.h ('k') | chrome/browser/ui/views/status_icons/status_icon_linux_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698