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

Side by Side Diff: chrome/browser/ui/gtk/status_icons/status_icon_gtk.cc

Issue 10377122: Convert GdkPixbufFromSkBitmap and GdkPixbufToSkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gtk/status_icons/status_icon_gtk.h" 5 #include "chrome/browser/ui/gtk/status_icons/status_icon_gtk.h"
6 6
7 #include "base/string16.h" 7 #include "base/string16.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/ui/gtk/menu_gtk.h" 9 #include "chrome/browser/ui/gtk/menu_gtk.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 StatusIconGtk::~StatusIconGtk() { 23 StatusIconGtk::~StatusIconGtk() {
24 g_object_unref(icon_); 24 g_object_unref(icon_);
25 } 25 }
26 26
27 void StatusIconGtk::SetImage(const SkBitmap& image) { 27 void StatusIconGtk::SetImage(const SkBitmap& image) {
28 if (image.isNull()) 28 if (image.isNull())
29 return; 29 return;
30 30
31 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&image); 31 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(image);
32 gtk_status_icon_set_from_pixbuf(icon_, pixbuf); 32 gtk_status_icon_set_from_pixbuf(icon_, pixbuf);
33 g_object_unref(pixbuf); 33 g_object_unref(pixbuf);
34 } 34 }
35 35
36 void StatusIconGtk::SetPressedImage(const SkBitmap& image) { 36 void StatusIconGtk::SetPressedImage(const SkBitmap& image) {
37 // Ignore pressed images, since the standard on Linux is to not highlight 37 // Ignore pressed images, since the standard on Linux is to not highlight
38 // pressed status icons. 38 // pressed status icons.
39 } 39 }
40 40
41 void StatusIconGtk::SetToolTip(const string16& tool_tip) { 41 void StatusIconGtk::SetToolTip(const string16& tool_tip) {
(...skipping 15 matching lines...) Expand all
57 menu_.reset(); 57 menu_.reset();
58 else 58 else
59 menu_.reset(new MenuGtk(NULL, model)); 59 menu_.reset(new MenuGtk(NULL, model));
60 } 60 }
61 61
62 void StatusIconGtk::OnPopupMenu(GtkWidget* widget, guint button, guint time) { 62 void StatusIconGtk::OnPopupMenu(GtkWidget* widget, guint button, guint time) {
63 // If we have a menu - display it. 63 // If we have a menu - display it.
64 if (menu_.get()) 64 if (menu_.get())
65 menu_->PopupAsContextForStatusIcon(time, button, icon_); 65 menu_->PopupAsContextForStatusIcon(time, button, icon_);
66 } 66 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc ('k') | chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698