| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/browser_dialogs.h" | 5 #include "chrome/browser/ui/browser_dialogs.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 gtk_list_store_clear(model_); | 184 gtk_list_store_clear(model_); |
| 185 | 185 |
| 186 GtkTreeIter tree_iter; | 186 GtkTreeIter tree_iter; |
| 187 for (TabContentsIterator it; !it.done(); ++it) { | 187 for (TabContentsIterator it; !it.done(); ++it) { |
| 188 if (it->web_contents()->GetRenderProcessHost() == | 188 if (it->web_contents()->GetRenderProcessHost() == |
| 189 hung_contents->GetRenderProcessHost()) { | 189 hung_contents->GetRenderProcessHost()) { |
| 190 gtk_list_store_append(model_, &tree_iter); | 190 gtk_list_store_append(model_, &tree_iter); |
| 191 std::string title = UTF16ToUTF8(it->web_contents()->GetTitle()); | 191 std::string title = UTF16ToUTF8(it->web_contents()->GetTitle()); |
| 192 if (title.empty()) | 192 if (title.empty()) |
| 193 title = UTF16ToUTF8(CoreTabHelper::GetDefaultTitle()); | 193 title = UTF16ToUTF8(CoreTabHelper::GetDefaultTitle()); |
| 194 SkBitmap favicon = it->favicon_tab_helper()->GetFavicon().AsBitmap(); | 194 FaviconTabHelper* favicon_tab_helper = |
| 195 FaviconTabHelper::FromWebContents(it->web_contents()); |
| 196 SkBitmap favicon = favicon_tab_helper->GetFavicon().AsBitmap(); |
| 195 | 197 |
| 196 GdkPixbuf* pixbuf = NULL; | 198 GdkPixbuf* pixbuf = NULL; |
| 197 if (favicon.width() > 0) | 199 if (favicon.width() > 0) |
| 198 pixbuf = gfx::GdkPixbufFromSkBitmap(favicon); | 200 pixbuf = gfx::GdkPixbufFromSkBitmap(favicon); |
| 199 gtk_list_store_set(model_, &tree_iter, | 201 gtk_list_store_set(model_, &tree_iter, |
| 200 COL_FAVICON, pixbuf, | 202 COL_FAVICON, pixbuf, |
| 201 COL_TITLE, title.c_str(), | 203 COL_TITLE, title.c_str(), |
| 202 -1); | 204 -1); |
| 203 if (pixbuf) | 205 if (pixbuf) |
| 204 g_object_unref(pixbuf); | 206 g_object_unref(pixbuf); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 g_instance->ShowForWebContents(contents); | 263 g_instance->ShowForWebContents(contents); |
| 262 } | 264 } |
| 263 } | 265 } |
| 264 | 266 |
| 265 void HideHungRendererDialog(WebContents* contents) { | 267 void HideHungRendererDialog(WebContents* contents) { |
| 266 if (!logging::DialogsAreSuppressed() && g_instance) | 268 if (!logging::DialogsAreSuppressed() && g_instance) |
| 267 g_instance->EndForWebContents(contents); | 269 g_instance->EndForWebContents(contents); |
| 268 } | 270 } |
| 269 | 271 |
| 270 } // namespace chrome | 272 } // namespace chrome |
| OLD | NEW |