| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 GtkWidget* content_area = gtk_dialog_get_content_area(dialog_); | 132 GtkWidget* content_area = gtk_dialog_get_content_area(dialog_); |
| 133 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); | 133 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); |
| 134 | 134 |
| 135 GtkWidget* hbox = gtk_hbox_new(FALSE, 12); | 135 GtkWidget* hbox = gtk_hbox_new(FALSE, 12); |
| 136 gtk_box_pack_start(GTK_BOX(content_area), hbox, TRUE, TRUE, 0); | 136 gtk_box_pack_start(GTK_BOX(content_area), hbox, TRUE, TRUE, 0); |
| 137 | 137 |
| 138 // Wrap the icon in a vbox so it stays top aligned. | 138 // Wrap the icon in a vbox so it stays top aligned. |
| 139 GtkWidget* icon_vbox = gtk_vbox_new(FALSE, 0); | 139 GtkWidget* icon_vbox = gtk_vbox_new(FALSE, 0); |
| 140 gtk_box_pack_start(GTK_BOX(hbox), icon_vbox, FALSE, FALSE, 0); | 140 gtk_box_pack_start(GTK_BOX(hbox), icon_vbox, FALSE, FALSE, 0); |
| 141 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 141 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 142 GdkPixbuf* icon_pixbuf = rb.GetNativeImageNamed(IDR_FROZEN_TAB_ICON); | 142 GdkPixbuf* icon_pixbuf = rb.GetNativeImageNamed( |
| 143 IDR_FROZEN_TAB_ICON).ToGdkPixbuf(); |
| 143 GtkWidget* icon = gtk_image_new_from_pixbuf(icon_pixbuf); | 144 GtkWidget* icon = gtk_image_new_from_pixbuf(icon_pixbuf); |
| 144 gtk_box_pack_start(GTK_BOX(icon_vbox), icon, FALSE, FALSE, 0); | 145 gtk_box_pack_start(GTK_BOX(icon_vbox), icon, FALSE, FALSE, 0); |
| 145 | 146 |
| 146 GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); | 147 GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); |
| 147 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); | 148 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); |
| 148 | 149 |
| 149 GtkWidget* text = gtk_label_new( | 150 GtkWidget* text = gtk_label_new( |
| 150 l10n_util::GetStringUTF8(IDS_BROWSER_HANGMONITOR_RENDERER).c_str()); | 151 l10n_util::GetStringUTF8(IDS_BROWSER_HANGMONITOR_RENDERER).c_str()); |
| 151 gtk_label_set_line_wrap(GTK_LABEL(text), TRUE); | 152 gtk_label_set_line_wrap(GTK_LABEL(text), TRUE); |
| 152 gtk_box_pack_start(GTK_BOX(vbox), text, FALSE, FALSE, 0); | 153 gtk_box_pack_start(GTK_BOX(vbox), text, FALSE, FALSE, 0); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 g_instance->ShowForWebContents(contents); | 261 g_instance->ShowForWebContents(contents); |
| 261 } | 262 } |
| 262 } | 263 } |
| 263 | 264 |
| 264 void HideHungRendererDialog(WebContents* contents) { | 265 void HideHungRendererDialog(WebContents* contents) { |
| 265 if (!logging::DialogsAreSuppressed() && g_instance) | 266 if (!logging::DialogsAreSuppressed() && g_instance) |
| 266 g_instance->EndForWebContents(contents); | 267 g_instance->EndForWebContents(contents); |
| 267 } | 268 } |
| 268 | 269 |
| 269 } // namespace browser | 270 } // namespace browser |
| OLD | NEW |