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

Side by Side Diff: ui/base/gtk/gtk_signal_registrar.h

Issue 6257006: Move a bunch of random other files to src/ui/base... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
« no previous file with comments | « ui/base/gtk/gtk_signal.h ('k') | ui/base/gtk/gtk_signal_registrar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 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 #ifndef APP_GTK_SIGNAL_REGISTRAR_H_ 5 #ifndef UI_BASE_GTK_GTK_SIGNAL_REGISTRAR_H_
6 #define APP_GTK_SIGNAL_REGISTRAR_H_ 6 #define UI_BASE_GTK_GTK_SIGNAL_REGISTRAR_H_
7 #pragma once 7 #pragma once
8 8
9 #include <glib.h> 9 #include <glib.h>
10 #include <map> 10 #include <map>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 14
15 typedef void (*GCallback) (void); 15 typedef void (*GCallback) (void);
16 typedef struct _GObject GObject; 16 typedef struct _GObject GObject;
17 typedef struct _GtkWidget GtkWidget; 17 typedef struct _GtkWidget GtkWidget;
18 18
19 namespace ui {
20
19 // A class that ensures that callbacks don't run on stale owner objects. Similar 21 // A class that ensures that callbacks don't run on stale owner objects. Similar
20 // in spirit to NotificationRegistrar. Use as follows: 22 // in spirit to NotificationRegistrar. Use as follows:
21 // 23 //
22 // class ChromeObject { 24 // class ChromeObject {
23 // public: 25 // public:
24 // ChromeObject() { 26 // ChromeObject() {
25 // ... 27 // ...
26 // 28 //
27 // signals_.Connect(widget, "event", CallbackThunk, this); 29 // signals_.Connect(widget, "event", CallbackThunk, this);
28 // } 30 // }
(...skipping 29 matching lines...) Expand all
58 void WeakNotify(GObject* where_the_object_was); 60 void WeakNotify(GObject* where_the_object_was);
59 61
60 glong ConnectInternal(gpointer instance, const gchar* detailed_signal, 62 glong ConnectInternal(gpointer instance, const gchar* detailed_signal,
61 GCallback signal_handler, gpointer data, bool after); 63 GCallback signal_handler, gpointer data, bool after);
62 64
63 HandlerMap handler_lists_; 65 HandlerMap handler_lists_;
64 66
65 DISALLOW_COPY_AND_ASSIGN(GtkSignalRegistrar); 67 DISALLOW_COPY_AND_ASSIGN(GtkSignalRegistrar);
66 }; 68 };
67 69
68 #endif // APP_GTK_SIGNAL_REGISTRAR_H_ 70 } // namespace ui
71
72 #endif // UI_BASE_GTK_GTK_SIGNAL_REGISTRAR_H_
OLDNEW
« no previous file with comments | « ui/base/gtk/gtk_signal.h ('k') | ui/base/gtk/gtk_signal_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698