| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/one_click_signin_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/one_click_signin_bubble_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" | 12 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" |
| 13 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 13 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 14 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 14 #include "chrome/browser/ui/gtk/gtk_util.h" | 15 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 15 #include "chrome/browser/ui/gtk/theme_service_gtk.h" | |
| 16 #include "grit/chromium_strings.h" | 16 #include "grit/chromium_strings.h" |
| 17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // Padding between content and edge of bubble (in pixels). | 22 // Padding between content and edge of bubble (in pixels). |
| 23 const int kContentBorder = 7; | 23 const int kContentBorder = 7; |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| (...skipping 13 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // Message. | 40 // Message. |
| 41 GtkWidget* message_label = gtk_label_new( | 41 GtkWidget* message_label = gtk_label_new( |
| 42 l10n_util::GetStringFUTF8( | 42 l10n_util::GetStringFUTF8( |
| 43 IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE, | 43 IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE, |
| 44 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)).c_str()); | 44 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)).c_str()); |
| 45 gtk_label_set_line_wrap(GTK_LABEL(message_label), TRUE); | 45 gtk_label_set_line_wrap(GTK_LABEL(message_label), TRUE); |
| 46 gtk_misc_set_alignment(GTK_MISC(message_label), 0.0, 0.5); | 46 gtk_misc_set_alignment(GTK_MISC(message_label), 0.0, 0.5); |
| 47 gtk_box_pack_start(GTK_BOX(bubble_content), message_label, FALSE, FALSE, 0); | 47 gtk_box_pack_start(GTK_BOX(bubble_content), message_label, FALSE, FALSE, 0); |
| 48 | 48 |
| 49 ThemeServiceGtk* const theme_provider = ThemeServiceGtk::GetFrom( | 49 GtkThemeService* const theme_provider = GtkThemeService::GetFrom( |
| 50 browser_window_gtk->browser()->profile()); | 50 browser_window_gtk->browser()->profile()); |
| 51 | 51 |
| 52 GtkWidget* learn_more_line = gtk_hbox_new(FALSE, kContentBorder); | 52 GtkWidget* learn_more_line = gtk_hbox_new(FALSE, kContentBorder); |
| 53 gtk_box_pack_start(GTK_BOX(bubble_content), | 53 gtk_box_pack_start(GTK_BOX(bubble_content), |
| 54 learn_more_line, FALSE, FALSE, 0); | 54 learn_more_line, FALSE, FALSE, 0); |
| 55 | 55 |
| 56 // Learn more link. | 56 // Learn more link. |
| 57 GtkWidget* learn_more_link = theme_provider->BuildChromeLinkButton( | 57 GtkWidget* learn_more_link = theme_provider->BuildChromeLinkButton( |
| 58 l10n_util::GetStringUTF8(IDS_SYNC_PROMO_NTP_BUBBLE_LEARN_MORE)); | 58 l10n_util::GetStringUTF8(IDS_SYNC_PROMO_NTP_BUBBLE_LEARN_MORE)); |
| 59 g_signal_connect(learn_more_link, "clicked", | 59 g_signal_connect(learn_more_link, "clicked", |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 void OneClickSigninBubbleGtk::OnClickAdvancedLink(GtkWidget* link) { | 120 void OneClickSigninBubbleGtk::OnClickAdvancedLink(GtkWidget* link) { |
| 121 advanced_callback_.Run(); | 121 advanced_callback_.Run(); |
| 122 bubble_->Close(); | 122 bubble_->Close(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void OneClickSigninBubbleGtk::OnClickOK(GtkWidget* link) { | 125 void OneClickSigninBubbleGtk::OnClickOK(GtkWidget* link) { |
| 126 bubble_->Close(); | 126 bubble_->Close(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 OneClickSigninBubbleGtk::~OneClickSigninBubbleGtk() {} | 129 OneClickSigninBubbleGtk::~OneClickSigninBubbleGtk() {} |
| OLD | NEW |