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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 cairo_fill(cr); | 95 cairo_fill(cr); |
96 cairo_destroy(cr); | 96 cairo_destroy(cr); |
97 return FALSE; | 97 return FALSE; |
98 } | 98 } |
99 | 99 |
100 } // namespace | 100 } // namespace |
101 | 101 |
102 void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { | 102 void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { |
103 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 103 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
104 static GdkPixbuf* background = rb.GetNativeImageNamed(IDR_ABOUT_BACKGROUND); | 104 static GdkPixbuf* background = rb.GetNativeImageNamed(IDR_ABOUT_BACKGROUND); |
105 chrome::VersionInfo version_info; | |
106 std::string current_version = version_info.Version(); | |
107 #if !defined(GOOGLE_CHROME_BUILD) | |
108 current_version += " ("; | |
109 current_version += l10n_util::GetStringUTF8( | |
110 version_info.IsOfficialBuild() ? | |
111 IDS_ABOUT_VERSION_OFFICIAL : IDS_ABOUT_VERSION_UNOFFICIAL); | |
112 current_version += " "; | |
113 current_version += version_info.LastChange(); | |
114 current_version += " "; | |
115 current_version += version_info.OSType(); | |
116 current_version += ")"; | |
117 #endif | |
118 std::string channel = chrome::VersionInfo::GetVersionStringModifier(); | |
119 if (!channel.empty()) | |
120 current_version += " " + channel; | |
121 | 105 |
122 // Build the dialog. | 106 // Build the dialog. |
123 GtkWidget* dialog = gtk_dialog_new_with_buttons( | 107 GtkWidget* dialog = gtk_dialog_new_with_buttons( |
124 l10n_util::GetStringUTF8(IDS_ABOUT_CHROME_TITLE).c_str(), | 108 l10n_util::GetStringUTF8(IDS_ABOUT_CHROME_TITLE).c_str(), |
125 parent, | 109 parent, |
126 GTK_DIALOG_MODAL, | 110 GTK_DIALOG_MODAL, |
127 NULL); | 111 NULL); |
128 // Pick up the style set in gtk_util.cc:InitRCStyles(). | 112 // Pick up the style set in gtk_util.cc:InitRCStyles(). |
129 // The layout of this dialog is special because the logo should be flush | 113 // The layout of this dialog is special because the logo should be flush |
130 // with the edges of the window. | 114 // with the edges of the window. |
(...skipping 19 matching lines...) Expand all Loading... |
150 | 134 |
151 GtkWidget* text_vbox = gtk_vbox_new(FALSE, kExtraLineSpacing); | 135 GtkWidget* text_vbox = gtk_vbox_new(FALSE, kExtraLineSpacing); |
152 | 136 |
153 GdkColor black = gtk_util::kGdkBlack; | 137 GdkColor black = gtk_util::kGdkBlack; |
154 GtkWidget* product_label = MakeMarkupLabel( | 138 GtkWidget* product_label = MakeMarkupLabel( |
155 "<span font_desc=\"18\" style=\"normal\">%s</span>", | 139 "<span font_desc=\"18\" style=\"normal\">%s</span>", |
156 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME)); | 140 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME)); |
157 gtk_widget_modify_fg(product_label, GTK_STATE_NORMAL, &black); | 141 gtk_widget_modify_fg(product_label, GTK_STATE_NORMAL, &black); |
158 gtk_box_pack_start(GTK_BOX(text_vbox), product_label, FALSE, FALSE, 0); | 142 gtk_box_pack_start(GTK_BOX(text_vbox), product_label, FALSE, FALSE, 0); |
159 | 143 |
160 GtkWidget* version_label = gtk_label_new(current_version.c_str()); | 144 chrome::VersionInfo version_info; |
| 145 GtkWidget* version_label = gtk_label_new( |
| 146 version_info.CreateVersionString().c_str()); |
161 gtk_misc_set_alignment(GTK_MISC(version_label), 0.0, 0.5); | 147 gtk_misc_set_alignment(GTK_MISC(version_label), 0.0, 0.5); |
162 gtk_label_set_selectable(GTK_LABEL(version_label), TRUE); | 148 gtk_label_set_selectable(GTK_LABEL(version_label), TRUE); |
163 gtk_widget_modify_fg(version_label, GTK_STATE_NORMAL, &black); | 149 gtk_widget_modify_fg(version_label, GTK_STATE_NORMAL, &black); |
164 gtk_box_pack_start(GTK_BOX(text_vbox), version_label, FALSE, FALSE, 0); | 150 gtk_box_pack_start(GTK_BOX(text_vbox), version_label, FALSE, FALSE, 0); |
165 | 151 |
166 gtk_container_add(GTK_CONTAINER(text_alignment), text_vbox); | 152 gtk_container_add(GTK_CONTAINER(text_alignment), text_vbox); |
167 gtk_box_pack_start(GTK_BOX(hbox), text_alignment, TRUE, TRUE, 0); | 153 gtk_box_pack_start(GTK_BOX(hbox), text_alignment, TRUE, TRUE, 0); |
168 | 154 |
169 GtkWidget* image_vbox = gtk_vbox_new(FALSE, 0); | 155 GtkWidget* image_vbox = gtk_vbox_new(FALSE, 0); |
170 gtk_box_pack_end(GTK_BOX(image_vbox), | 156 gtk_box_pack_end(GTK_BOX(image_vbox), |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 gtk_util::kContentAreaBorder, 0, | 270 gtk_util::kContentAreaBorder, 0, |
285 gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder); | 271 gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder); |
286 gtk_container_add(GTK_CONTAINER(alignment), vbox); | 272 gtk_container_add(GTK_CONTAINER(alignment), vbox); |
287 gtk_box_pack_start(GTK_BOX(content_area), alignment, FALSE, FALSE, 0); | 273 gtk_box_pack_start(GTK_BOX(content_area), alignment, FALSE, FALSE, 0); |
288 | 274 |
289 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), NULL); | 275 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), NULL); |
290 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); | 276 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
291 gtk_widget_show_all(dialog); | 277 gtk_widget_show_all(dialog); |
292 gtk_widget_grab_focus(close_button); | 278 gtk_widget_grab_focus(close_button); |
293 } | 279 } |
OLD | NEW |