diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 22:07:11 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 22:07:11 +0000 |
commit | d7fc97946625fee2c54e18bce4f61608efeeef03 (patch) | |
tree | e2033035f58d2342f55cdb677e38d281cc655152 /views/widget | |
parent | b12d815dbd8295b3e7f5e4b4a7350aebc580270c (diff) | |
download | chromium_src-d7fc97946625fee2c54e18bce4f61608efeeef03.zip chromium_src-d7fc97946625fee2c54e18bce4f61608efeeef03.tar.gz chromium_src-d7fc97946625fee2c54e18bce4f61608efeeef03.tar.bz2 |
Fixes two issues from valgrind, and some cleanup:
. Makes it so observer installed by WidgetGtk is cleaned up and not
leaked.
. Removes unnecessary static_cast<int> in view.
. Fixes some leaks in textfield and button.
. Removes AutocompletePopupViewGTK's copy of PangoFontFromGfxFont.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/420005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/widget_gtk.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 8762e14..87fdb8d 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -25,7 +25,11 @@ namespace views { // drag-leave that GTK generates. class WidgetGtk::DropObserver : public MessageLoopForUI::Observer { public: - DropObserver() { } + DropObserver() {} + + static DropObserver* Get() { + return Singleton<DropObserver>::get(); + } virtual void WillProcessEvent(GdkEvent* event) { if (event->type == GDK_DROP_START) { @@ -98,7 +102,7 @@ WidgetGtk::WidgetGtk(Type type) installed_message_loop_observer = true; MessageLoopForUI* loop = MessageLoopForUI::current(); if (loop) - loop->AddObserver(new DropObserver()); + loop->AddObserver(DropObserver::Get()); } if (type_ != TYPE_CHILD) @@ -1082,7 +1086,8 @@ gboolean WidgetGtk::CallQueryTooltip(GtkWidget* widget, gboolean keyboard_mode, GtkTooltip* tooltip, WidgetGtk* host) { - return host->OnQueryTooltip(x, y, keyboard_mode, tooltip); + return host->OnQueryTooltip(static_cast<int>(x), static_cast<int>(y), + keyboard_mode, tooltip); } gboolean WidgetGtk::CallScroll(GtkWidget* widget, GdkEventScroll* event) { |