OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/hung_renderer_dialog.h" | 5 #include "chrome/browser/hung_renderer_dialog.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 GtkTreeIter tree_iter; | 151 GtkTreeIter tree_iter; |
152 for (TabContentsIterator it; !it.done(); ++it) { | 152 for (TabContentsIterator it; !it.done(); ++it) { |
153 if (it->GetRenderProcessHost() == hung_contents->GetRenderProcessHost()) { | 153 if (it->GetRenderProcessHost() == hung_contents->GetRenderProcessHost()) { |
154 gtk_list_store_append(model_, &tree_iter); | 154 gtk_list_store_append(model_, &tree_iter); |
155 std::string title = UTF16ToUTF8(it->GetTitle()); | 155 std::string title = UTF16ToUTF8(it->GetTitle()); |
156 if (title.empty()) | 156 if (title.empty()) |
157 title = UTF16ToUTF8(TabContents::GetDefaultTitle()); | 157 title = UTF16ToUTF8(TabContents::GetDefaultTitle()); |
158 SkBitmap favicon = it->GetFavIcon(); | 158 SkBitmap favicon = it->GetFavIcon(); |
159 | 159 |
| 160 GdkPixbuf* pixbuf = NULL; |
| 161 if (favicon.width() > 0) |
| 162 pixbuf = gfx::GdkPixbufFromSkBitmap(&favicon); |
160 gtk_list_store_set(model_, &tree_iter, | 163 gtk_list_store_set(model_, &tree_iter, |
161 COL_FAVICON, favicon.width() > 0 | 164 COL_FAVICON, pixbuf, |
162 ? gfx::GdkPixbufFromSkBitmap(&favicon) | |
163 : NULL, | |
164 COL_TITLE, title.c_str(), | 165 COL_TITLE, title.c_str(), |
165 -1); | 166 -1); |
| 167 if (pixbuf) |
| 168 g_object_unref(pixbuf); |
166 } | 169 } |
167 } | 170 } |
168 gtk_widget_show_all(GTK_WIDGET(dialog_)); | 171 gtk_widget_show_all(GTK_WIDGET(dialog_)); |
169 } | 172 } |
170 | 173 |
171 void HungRendererDialogGtk::EndForTabContents(TabContents* contents) { | 174 void HungRendererDialogGtk::EndForTabContents(TabContents* contents) { |
172 DCHECK(contents); | 175 DCHECK(contents); |
173 if (contents_ && contents_->GetRenderProcessHost() == | 176 if (contents_ && contents_->GetRenderProcessHost() == |
174 contents->GetRenderProcessHost()) { | 177 contents->GetRenderProcessHost()) { |
175 gtk_widget_hide(GTK_WIDGET(dialog_)); | 178 gtk_widget_hide(GTK_WIDGET(dialog_)); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 219 } |
217 } | 220 } |
218 | 221 |
219 // static | 222 // static |
220 void HideForTabContents(TabContents* contents) { | 223 void HideForTabContents(TabContents* contents) { |
221 if (!logging::DialogsAreSuppressed() && g_instance) | 224 if (!logging::DialogsAreSuppressed() && g_instance) |
222 g_instance->EndForTabContents(contents); | 225 g_instance->EndForTabContents(contents); |
223 } | 226 } |
224 | 227 |
225 } // namespace hung_renderer_dialog | 228 } // namespace hung_renderer_dialog |
226 | |
OLD | NEW |