| 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/about_chrome_dialog.h" | 5 #include "chrome/browser/ui/gtk/about_chrome_dialog.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // These are used as placeholder text around the links in the text in the about | 43 // These are used as placeholder text around the links in the text in the about |
| 44 // dialog. | 44 // dialog. |
| 45 const char* kBeginLinkChr = "BEGIN_LINK_CHR"; | 45 const char* kBeginLinkChr = "BEGIN_LINK_CHR"; |
| 46 const char* kBeginLinkOss = "BEGIN_LINK_OSS"; | 46 const char* kBeginLinkOss = "BEGIN_LINK_OSS"; |
| 47 // We don't actually use this one. | 47 // We don't actually use this one. |
| 48 // const char* kEndLinkChr = "END_LINK_CHR"; | 48 // const char* kEndLinkChr = "END_LINK_CHR"; |
| 49 const char* kEndLinkOss = "END_LINK_OSS"; | 49 const char* kEndLinkOss = "END_LINK_OSS"; |
| 50 const char* kBeginLink = "BEGIN_LINK"; | 50 const char* kBeginLink = "BEGIN_LINK"; |
| 51 const char* kEndLink = "END_LINK"; | 51 const char* kEndLink = "END_LINK"; |
| 52 | 52 |
| 53 void OnDialogResponse(GtkDialog* dialog, int response_id) { | 53 void OnResponse(GtkWidget* dialog, int response_id) { |
| 54 // We're done. | 54 // We're done. |
| 55 gtk_widget_destroy(GTK_WIDGET(dialog)); | 55 gtk_widget_destroy(dialog); |
| 56 } | 56 } |
| 57 | 57 |
| 58 GtkWidget* MakeMarkupLabel(const char* format, const std::string& str) { | 58 GtkWidget* MakeMarkupLabel(const char* format, const std::string& str) { |
| 59 GtkWidget* label = gtk_label_new(NULL); | 59 GtkWidget* label = gtk_label_new(NULL); |
| 60 char* markup = g_markup_printf_escaped(format, str.c_str()); | 60 char* markup = g_markup_printf_escaped(format, str.c_str()); |
| 61 gtk_label_set_markup(GTK_LABEL(label), markup); | 61 gtk_label_set_markup(GTK_LABEL(label), markup); |
| 62 g_free(markup); | 62 g_free(markup); |
| 63 | 63 |
| 64 // Left align it. | 64 // Left align it. |
| 65 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); | 65 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 gtk_box_pack_start(GTK_BOX(vbox), tos_hbox, TRUE, TRUE, 0); | 273 gtk_box_pack_start(GTK_BOX(vbox), tos_hbox, TRUE, TRUE, 0); |
| 274 #endif | 274 #endif |
| 275 | 275 |
| 276 GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); | 276 GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); |
| 277 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), | 277 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), |
| 278 gtk_util::kContentAreaBorder, 0, | 278 gtk_util::kContentAreaBorder, 0, |
| 279 gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder); | 279 gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder); |
| 280 gtk_container_add(GTK_CONTAINER(alignment), vbox); | 280 gtk_container_add(GTK_CONTAINER(alignment), vbox); |
| 281 gtk_box_pack_start(GTK_BOX(content_area), alignment, FALSE, FALSE, 0); | 281 gtk_box_pack_start(GTK_BOX(content_area), alignment, FALSE, FALSE, 0); |
| 282 | 282 |
| 283 g_signal_connect(dialog, "response", G_CALLBACK(OnDialogResponse), NULL); | 283 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), NULL); |
| 284 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); | 284 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
| 285 gtk_widget_show_all(dialog); | 285 gtk_widget_show_all(dialog); |
| 286 gtk_widget_grab_focus(close_button); | 286 gtk_widget_grab_focus(close_button); |
| 287 } | 287 } |
| OLD | NEW |