| 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> |
| 11 | 11 |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/google/google_util.h" | 13 #include "chrome/browser/google/google_util.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/ui/browser_list.h" | 15 #include "chrome/browser/ui/browser_list.h" |
| 16 #include "chrome/browser/ui/gtk/cairo_cached_surface.h" | 16 #include "chrome/browser/ui/gtk/cairo_cached_surface.h" |
| 17 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 17 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
| 18 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 18 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 19 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 19 #include "chrome/common/chrome_constants.h" | 20 #include "chrome/common/chrome_constants.h" |
| 20 #include "chrome/common/chrome_version_info.h" | 21 #include "chrome/common/chrome_version_info.h" |
| 21 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
| 22 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
| 23 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 24 #include "grit/locale_settings.h" | 25 #include "grit/locale_settings.h" |
| 25 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
| 26 #include "ui/base/gtk/gtk_hig_constants.h" | |
| 27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 28 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 29 #include "ui/gfx/image/image.h" | 29 #include "ui/gfx/image/image.h" |
| 30 #include "webkit/glue/webkit_glue.h" | 30 #include "webkit/glue/webkit_glue.h" |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 // Left or right margin. | 34 // Left or right margin. |
| 35 const int kPanelHorizMargin = 13; | 35 const int kPanelHorizMargin = 13; |
| 36 | 36 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 GtkWidget* hbox = gtk_hbox_new(FALSE, 0); | 128 GtkWidget* hbox = gtk_hbox_new(FALSE, 0); |
| 129 | 129 |
| 130 GtkWidget* text_alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); | 130 GtkWidget* text_alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); |
| 131 gtk_alignment_set_padding(GTK_ALIGNMENT(text_alignment), | 131 gtk_alignment_set_padding(GTK_ALIGNMENT(text_alignment), |
| 132 kPanelVertMargin, kPanelVertMargin, | 132 kPanelVertMargin, kPanelVertMargin, |
| 133 kPanelHorizMargin, kPanelHorizMargin); | 133 kPanelHorizMargin, kPanelHorizMargin); |
| 134 | 134 |
| 135 GtkWidget* text_vbox = gtk_vbox_new(FALSE, kExtraLineSpacing); | 135 GtkWidget* text_vbox = gtk_vbox_new(FALSE, kExtraLineSpacing); |
| 136 | 136 |
| 137 GdkColor black = ui::kGdkBlack; | 137 GdkColor black = gtk_util::kGdkBlack; |
| 138 GtkWidget* product_label = MakeMarkupLabel( | 138 GtkWidget* product_label = MakeMarkupLabel( |
| 139 "<span font_desc=\"18\" style=\"normal\">%s</span>", | 139 "<span font_desc=\"18\" style=\"normal\">%s</span>", |
| 140 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME)); | 140 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME)); |
| 141 gtk_widget_modify_fg(product_label, GTK_STATE_NORMAL, &black); | 141 gtk_widget_modify_fg(product_label, GTK_STATE_NORMAL, &black); |
| 142 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); |
| 143 | 143 |
| 144 chrome::VersionInfo version_info; | 144 chrome::VersionInfo version_info; |
| 145 GtkWidget* version_label = gtk_label_new( | 145 GtkWidget* version_label = gtk_label_new( |
| 146 version_info.CreateVersionString().c_str()); | 146 version_info.CreateVersionString().c_str()); |
| 147 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); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 gtk_box_pack_start(GTK_BOX(tos_hbox), tos_link, FALSE, FALSE, 0); | 260 gtk_box_pack_start(GTK_BOX(tos_hbox), tos_link, FALSE, FALSE, 0); |
| 261 gtk_box_pack_start(GTK_BOX(tos_hbox), tos_chunk2, FALSE, FALSE, 0); | 261 gtk_box_pack_start(GTK_BOX(tos_hbox), tos_chunk2, FALSE, FALSE, 0); |
| 262 | 262 |
| 263 g_signal_connect(tos_link, "clicked", G_CALLBACK(OnLinkButtonClick), | 263 g_signal_connect(tos_link, "clicked", G_CALLBACK(OnLinkButtonClick), |
| 264 const_cast<char*>(chrome::kChromeUITermsURL)); | 264 const_cast<char*>(chrome::kChromeUITermsURL)); |
| 265 gtk_box_pack_start(GTK_BOX(vbox), tos_hbox, TRUE, TRUE, 0); | 265 gtk_box_pack_start(GTK_BOX(vbox), tos_hbox, TRUE, TRUE, 0); |
| 266 #endif | 266 #endif |
| 267 | 267 |
| 268 GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); | 268 GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); |
| 269 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), | 269 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), |
| 270 ui::kContentAreaBorder, 0, | 270 gtk_util::kContentAreaBorder, 0, |
| 271 ui::kContentAreaBorder, ui::kContentAreaBorder); | 271 gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder); |
| 272 gtk_container_add(GTK_CONTAINER(alignment), vbox); | 272 gtk_container_add(GTK_CONTAINER(alignment), vbox); |
| 273 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); |
| 274 | 274 |
| 275 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), NULL); | 275 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), NULL); |
| 276 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); | 276 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
| 277 gtk_widget_show_all(dialog); | 277 gtk_widget_show_all(dialog); |
| 278 gtk_widget_grab_focus(close_button); | 278 gtk_widget_grab_focus(close_button); |
| 279 } | 279 } |
| OLD | NEW |