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/ui/gtk/update_recommended_dialog.h" | 5 #include "chrome/browser/ui/gtk/update_recommended_dialog.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 NULL); | 32 NULL); |
33 | 33 |
34 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); | 34 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); |
35 | 35 |
36 // Add the message text. | 36 // Add the message text. |
37 std::string text( | 37 std::string text( |
38 l10n_util::GetStringFUTF8(IDS_UPDATE_RECOMMENDED, | 38 l10n_util::GetStringFUTF8(IDS_UPDATE_RECOMMENDED, |
39 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 39 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
40 GtkWidget* label = gtk_label_new(text.c_str()); | 40 GtkWidget* label = gtk_label_new(text.c_str()); |
41 gtk_util::SetLabelWidth(label, kMessageWidth); | 41 gtk_util::SetLabelWidth(label, kMessageWidth); |
42 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), label, | 42 |
43 FALSE, FALSE, 0); | 43 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); |
| 44 gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0); |
44 | 45 |
45 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); | 46 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); |
46 | 47 |
47 gtk_widget_show_all(dialog_); | 48 gtk_widget_show_all(dialog_); |
48 } | 49 } |
49 | 50 |
50 UpdateRecommendedDialog::~UpdateRecommendedDialog() { | 51 UpdateRecommendedDialog::~UpdateRecommendedDialog() { |
51 } | 52 } |
52 | 53 |
53 void UpdateRecommendedDialog::OnResponse(GtkWidget* dialog, int response_id) { | 54 void UpdateRecommendedDialog::OnResponse(GtkWidget* dialog, int response_id) { |
54 gtk_widget_destroy(dialog_); | 55 gtk_widget_destroy(dialog_); |
55 | 56 |
56 if (response_id == GTK_RESPONSE_ACCEPT) { | 57 if (response_id == GTK_RESPONSE_ACCEPT) { |
57 BrowserList::AttemptRestart(); | 58 BrowserList::AttemptRestart(); |
58 } | 59 } |
59 | 60 |
60 delete this; | 61 delete this; |
61 } | 62 } |
OLD | NEW |