| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gfx/gtk_util.h" | 9 #include "app/gfx/gtk_util.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // ||·----·|| The folowing page(s).. ||| | 86 // ||·----·|| The folowing page(s).. ||| |
| 87 // || || ||| | 87 // || || ||| |
| 88 // || ||------------------------||| | 88 // || ||------------------------||| |
| 89 // || || table of tabs ||| | 89 // || || table of tabs ||| |
| 90 // || |·------------------------·|| | 90 // || |·------------------------·|| |
| 91 // |·---------------------------------·| | 91 // |·---------------------------------·| |
| 92 // | | | 92 // | | |
| 93 // | kill button wait button| | 93 // | kill button wait button| |
| 94 // ·-----------------------------------· | 94 // ·-----------------------------------· |
| 95 GtkWidget* contents_vbox = dialog_->vbox; | 95 GtkWidget* contents_vbox = dialog_->vbox; |
| 96 gtk_container_set_border_width(GTK_CONTAINER(contents_vbox), 12); | 96 gtk_box_set_spacing(GTK_BOX(contents_vbox), 18); |
| 97 | 97 |
| 98 GtkWidget* hbox = gtk_hbox_new(false, 12); | 98 GtkWidget* hbox = gtk_hbox_new(FALSE, 12); |
| 99 gtk_box_pack_start(GTK_BOX(contents_vbox), hbox, TRUE, TRUE, 0); | 99 gtk_box_pack_start(GTK_BOX(contents_vbox), hbox, TRUE, TRUE, 0); |
| 100 | 100 |
| 101 // Wrap the icon in a vbox so it stays top aligned. | 101 // Wrap the icon in a vbox so it stays top aligned. |
| 102 GtkWidget* icon_vbox = gtk_vbox_new(false, 0); | 102 GtkWidget* icon_vbox = gtk_vbox_new(FALSE, 0); |
| 103 gtk_box_pack_start(GTK_BOX(hbox), icon_vbox, FALSE, FALSE, 0); | 103 gtk_box_pack_start(GTK_BOX(hbox), icon_vbox, FALSE, FALSE, 0); |
| 104 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 104 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 105 GdkPixbuf* icon_pixbuf = rb.GetPixbufNamed(IDR_FROZEN_TAB_ICON); | 105 GdkPixbuf* icon_pixbuf = rb.GetPixbufNamed(IDR_FROZEN_TAB_ICON); |
| 106 GtkWidget* icon = gtk_image_new_from_pixbuf(icon_pixbuf); | 106 GtkWidget* icon = gtk_image_new_from_pixbuf(icon_pixbuf); |
| 107 gtk_box_pack_start(GTK_BOX(icon_vbox), icon, FALSE, FALSE, 0); | 107 gtk_box_pack_start(GTK_BOX(icon_vbox), icon, FALSE, FALSE, 0); |
| 108 | 108 |
| 109 GtkWidget* vbox = gtk_vbox_new(false, 6); | 109 GtkWidget* vbox = gtk_vbox_new(FALSE, 6); |
| 110 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); | 110 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); |
| 111 | 111 |
| 112 GtkWidget* text = gtk_label_new( | 112 GtkWidget* text = gtk_label_new( |
| 113 l10n_util::GetStringUTF8(IDS_BROWSER_HANGMONITOR_RENDERER).c_str()); | 113 l10n_util::GetStringUTF8(IDS_BROWSER_HANGMONITOR_RENDERER).c_str()); |
| 114 gtk_label_set_line_wrap(GTK_LABEL(text), TRUE); | 114 gtk_label_set_line_wrap(GTK_LABEL(text), TRUE); |
| 115 gtk_box_pack_start(GTK_BOX(vbox), text, FALSE, FALSE, 0); | 115 gtk_box_pack_start(GTK_BOX(vbox), text, FALSE, FALSE, 0); |
| 116 | 116 |
| 117 GtkWidget* scroll_list = gtk_scrolled_window_new(NULL, NULL); | 117 GtkWidget* scroll_list = gtk_scrolled_window_new(NULL, NULL); |
| 118 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_list), | 118 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_list), |
| 119 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | 119 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); |
| 120 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll_list), |
| 121 GTK_SHADOW_ETCHED_IN); |
| 120 gtk_box_pack_start(GTK_BOX(vbox), scroll_list, TRUE, TRUE, 0); | 122 gtk_box_pack_start(GTK_BOX(vbox), scroll_list, TRUE, TRUE, 0); |
| 121 | 123 |
| 122 // The list of hung tabs is GtkTreeView with a GtkListStore as the model. | 124 // The list of hung tabs is GtkTreeView with a GtkListStore as the model. |
| 123 model_ = gtk_list_store_new(COL_COUNT, GDK_TYPE_PIXBUF, G_TYPE_STRING); | 125 model_ = gtk_list_store_new(COL_COUNT, GDK_TYPE_PIXBUF, G_TYPE_STRING); |
| 124 GtkWidget* tree_view = gtk_tree_view_new_with_model( | 126 GtkWidget* tree_view = gtk_tree_view_new_with_model( |
| 125 GTK_TREE_MODEL(model_)); | 127 GTK_TREE_MODEL(model_)); |
| 126 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree_view), FALSE); | 128 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree_view), FALSE); |
| 127 GtkTreeViewColumn* column = gtk_tree_view_column_new(); | 129 GtkTreeViewColumn* column = gtk_tree_view_column_new(); |
| 128 GtkCellRenderer* renderer = gtk_cell_renderer_pixbuf_new(); | 130 GtkCellRenderer* renderer = gtk_cell_renderer_pixbuf_new(); |
| 129 gtk_tree_view_column_pack_start(column, renderer, FALSE); | 131 gtk_tree_view_column_pack_start(column, renderer, FALSE); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 g_instance = new HungRendererDialogGtk(); | 208 g_instance = new HungRendererDialogGtk(); |
| 207 g_instance->ShowForTabContents(contents); | 209 g_instance->ShowForTabContents(contents); |
| 208 } | 210 } |
| 209 } | 211 } |
| 210 | 212 |
| 211 // static | 213 // static |
| 212 void HungRendererDialog::HideForTabContents(TabContents* contents) { | 214 void HungRendererDialog::HideForTabContents(TabContents* contents) { |
| 213 if (!logging::DialogsAreSuppressed() && g_instance) | 215 if (!logging::DialogsAreSuppressed() && g_instance) |
| 214 g_instance->EndForTabContents(contents); | 216 g_instance->EndForTabContents(contents); |
| 215 } | 217 } |
| OLD | NEW |