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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h

Issue 1394873003: Remove some unused files in libgtk2ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h b/chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h
deleted file mode 100644
index e83fbadc2498c8223c5039a3af0bbf5338901534..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2011 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.
-
-#ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_SIGNAL_REGISTRAR_H_
-#define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_SIGNAL_REGISTRAR_H_
-
-#include <glib.h>
-#include <map>
-#include <vector>
-
-#include "base/basictypes.h"
-
-typedef void (*GCallback) (void);
-typedef struct _GObject GObject;
-typedef struct _GtkWidget GtkWidget;
-
-namespace libgtk2ui {
-
-// A class that ensures that callbacks don't run on stale owner objects. Similar
-// in spirit to NotificationRegistrar. Use as follows:
-//
-// class ChromeObject {
-// public:
-// ChromeObject() {
-// ...
-//
-// signals_.Connect(widget, "event", CallbackThunk, this);
-// }
-//
-// ...
-//
-// private:
-// Gtk2SignalRegistrar signals_;
-// };
-//
-// When |signals_| goes down, it will disconnect the handlers connected via
-// Connect.
-class Gtk2SignalRegistrar {
- public:
- Gtk2SignalRegistrar();
- ~Gtk2SignalRegistrar();
-
- // Connect before the default handler. Returns the handler id.
- glong Connect(gpointer instance, const gchar* detailed_signal,
- GCallback signal_handler, gpointer data);
- // Connect after the default handler. Returns the handler id.
- glong ConnectAfter(gpointer instance, const gchar* detailed_signal,
- GCallback signal_handler, gpointer data);
-
- // Disconnects all signal handlers connected to |instance|.
- void DisconnectAll(gpointer instance);
-
- private:
- typedef std::vector<glong> HandlerList;
- typedef std::map<GObject*, HandlerList> HandlerMap;
-
- static void WeakNotifyThunk(gpointer data, GObject* where_the_object_was) {
- reinterpret_cast<Gtk2SignalRegistrar*>(data)->WeakNotify(
- where_the_object_was);
- }
- void WeakNotify(GObject* where_the_object_was);
-
- glong ConnectInternal(gpointer instance, const gchar* detailed_signal,
- GCallback signal_handler, gpointer data, bool after);
-
- HandlerMap handler_lists_;
-
- DISALLOW_COPY_AND_ASSIGN(Gtk2SignalRegistrar);
-};
-
-} // namespace libgtk2ui
-
-#endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_SIGNAL_REGISTRAR_H_
« no previous file with comments | « chrome/browser/ui/libgtk2ui/g_object_destructor_filo.cc ('k') | chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698