| OLD | NEW |
| 1 // Copyright (c) 2011 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 #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 "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/browser_list.h" | 11 #include "chrome/browser/browser_list.h" |
| 12 #include "chrome/browser/renderer_host/render_process_host.h" | 12 #include "chrome/browser/renderer_host/render_process_host.h" |
| 13 #include "chrome/browser/renderer_host/render_view_host.h" | 13 #include "chrome/browser/renderer_host/render_view_host.h" |
| 14 #include "chrome/browser/tab_contents/tab_contents.h" | 14 #include "chrome/browser/tab_contents/tab_contents.h" |
| 15 #include "chrome/browser/ui/gtk/gtk_util.h" | 15 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 16 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 16 #include "chrome/common/logging_chrome.h" | 17 #include "chrome/common/logging_chrome.h" |
| 17 #include "chrome/common/result_codes.h" | 18 #include "chrome/common/result_codes.h" |
| 18 #include "grit/chromium_strings.h" | 19 #include "grit/chromium_strings.h" |
| 19 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 20 #include "grit/theme_resources.h" | 21 #include "grit/theme_resources.h" |
| 21 #include "ui/base/gtk/gtk_signal.h" | 22 #include "ui/base/gtk/gtk_signal.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
| 24 #include "ui/gfx/gtk_util.h" | 25 #include "ui/gfx/gtk_util.h" |
| 25 | 26 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 DCHECK(hung_contents && dialog_); | 146 DCHECK(hung_contents && dialog_); |
| 146 contents_ = hung_contents; | 147 contents_ = hung_contents; |
| 147 gtk_list_store_clear(model_); | 148 gtk_list_store_clear(model_); |
| 148 | 149 |
| 149 GtkTreeIter tree_iter; | 150 GtkTreeIter tree_iter; |
| 150 for (TabContentsIterator it; !it.done(); ++it) { | 151 for (TabContentsIterator it; !it.done(); ++it) { |
| 151 if (it->GetRenderProcessHost() == hung_contents->GetRenderProcessHost()) { | 152 if (it->GetRenderProcessHost() == hung_contents->GetRenderProcessHost()) { |
| 152 gtk_list_store_append(model_, &tree_iter); | 153 gtk_list_store_append(model_, &tree_iter); |
| 153 std::string title = UTF16ToUTF8(it->GetTitle()); | 154 std::string title = UTF16ToUTF8(it->GetTitle()); |
| 154 if (title.empty()) | 155 if (title.empty()) |
| 155 title = UTF16ToUTF8(TabContents::GetDefaultTitle()); | 156 title = UTF16ToUTF8(TabContentsWrapper::GetDefaultTitle()); |
| 156 SkBitmap favicon = it->GetFavIcon(); | 157 SkBitmap favicon = it->GetFavIcon(); |
| 157 | 158 |
| 158 GdkPixbuf* pixbuf = NULL; | 159 GdkPixbuf* pixbuf = NULL; |
| 159 if (favicon.width() > 0) | 160 if (favicon.width() > 0) |
| 160 pixbuf = gfx::GdkPixbufFromSkBitmap(&favicon); | 161 pixbuf = gfx::GdkPixbufFromSkBitmap(&favicon); |
| 161 gtk_list_store_set(model_, &tree_iter, | 162 gtk_list_store_set(model_, &tree_iter, |
| 162 COL_FAVICON, pixbuf, | 163 COL_FAVICON, pixbuf, |
| 163 COL_TITLE, title.c_str(), | 164 COL_TITLE, title.c_str(), |
| 164 -1); | 165 -1); |
| 165 if (pixbuf) | 166 if (pixbuf) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 } | 221 } |
| 221 } | 222 } |
| 222 | 223 |
| 223 // static | 224 // static |
| 224 void HideForTabContents(TabContents* contents) { | 225 void HideForTabContents(TabContents* contents) { |
| 225 if (!logging::DialogsAreSuppressed() && g_instance) | 226 if (!logging::DialogsAreSuppressed() && g_instance) |
| 226 g_instance->EndForTabContents(contents); | 227 g_instance->EndForTabContents(contents); |
| 227 } | 228 } |
| 228 | 229 |
| 229 } // namespace hung_renderer_dialog | 230 } // namespace hung_renderer_dialog |
| OLD | NEW |