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

Unified Diff: chrome/browser/ui/libgtkui/gtk2_status_icon.cc

Issue 2453243002: Gtk3 UI: Rename files in libgtkui containing gtk2 in their name (Closed)
Patch Set: Fix git cl format mistake Created 4 years, 2 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
« no previous file with comments | « chrome/browser/ui/libgtkui/gtk2_status_icon.h ('k') | chrome/browser/ui/libgtkui/gtk2_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtkui/gtk2_status_icon.cc
diff --git a/chrome/browser/ui/libgtkui/gtk2_status_icon.cc b/chrome/browser/ui/libgtkui/gtk2_status_icon.cc
deleted file mode 100644
index b3e692c4be61fb5705a32c5a736f5d859426d14c..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/libgtkui/gtk2_status_icon.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/libgtkui/gtk2_status_icon.h"
-
-#include <gtk/gtk.h>
-
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/ui/libgtkui/app_indicator_icon_menu.h"
-#include "chrome/browser/ui/libgtkui/skia_utils_gtk2.h"
-#include "ui/base/models/menu_model.h"
-#include "ui/gfx/image/image_skia.h"
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-
-namespace libgtkui {
-
-Gtk2StatusIcon::Gtk2StatusIcon(const gfx::ImageSkia& image,
- const base::string16& tool_tip) {
- GdkPixbuf* pixbuf = GdkPixbufFromSkBitmap(*image.bitmap());
- gtk_status_icon_ = gtk_status_icon_new_from_pixbuf(pixbuf);
- g_object_unref(pixbuf);
-
- g_signal_connect(gtk_status_icon_, "activate", G_CALLBACK(OnClickThunk),
- this);
- g_signal_connect(gtk_status_icon_, "popup_menu",
- G_CALLBACK(OnContextMenuRequestedThunk), this);
- SetToolTip(tool_tip);
-}
-
-Gtk2StatusIcon::~Gtk2StatusIcon() {
- gtk_status_icon_set_visible(gtk_status_icon_, FALSE);
- g_object_unref(gtk_status_icon_);
-}
-
-void Gtk2StatusIcon::SetImage(const gfx::ImageSkia& image) {
- GdkPixbuf* pixbuf = GdkPixbufFromSkBitmap(*image.bitmap());
- gtk_status_icon_set_from_pixbuf(gtk_status_icon_, pixbuf);
- g_object_unref(pixbuf);
-}
-
-void Gtk2StatusIcon::SetToolTip(const base::string16& tool_tip) {
- gtk_status_icon_set_tooltip_text(gtk_status_icon_,
- base::UTF16ToUTF8(tool_tip).c_str());
-}
-
-void Gtk2StatusIcon::UpdatePlatformContextMenu(ui::MenuModel* model) {
- menu_.reset();
- if (model)
- menu_.reset(new AppIndicatorIconMenu(model));
-}
-
-void Gtk2StatusIcon::RefreshPlatformContextMenu() {
- if (menu_.get())
- menu_->Refresh();
-}
-
-void Gtk2StatusIcon::OnClick(GtkStatusIcon* status_icon) {
- if (delegate())
- delegate()->OnClick();
-}
-
-void Gtk2StatusIcon::OnContextMenuRequested(GtkStatusIcon* status_icon,
- guint button,
- guint32 activate_time) {
- if (menu_.get()) {
- gtk_menu_popup(menu_->GetGtkMenu(),
- NULL,
- NULL,
- gtk_status_icon_position_menu,
- gtk_status_icon_,
- button,
- activate_time);
- }
-}
-
-} // namespace libgtkui
« no previous file with comments | « chrome/browser/ui/libgtkui/gtk2_status_icon.h ('k') | chrome/browser/ui/libgtkui/gtk2_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698