OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 GtkWidget* content_area = | 117 GtkWidget* content_area = |
118 gtk_dialog_get_content_area(GTK_DIALOG(confirmation_window_)); | 118 gtk_dialog_get_content_area(GTK_DIALOG(confirmation_window_)); |
119 | 119 |
120 base::string16 dialog_text = | 120 base::string16 dialog_text = |
121 base::i18n::MessageFormatter::FormatWithNumberedArgs( | 121 base::i18n::MessageFormatter::FormatWithNumberedArgs( |
122 l10n_util::GetStringUTF16( | 122 l10n_util::GetStringUTF16( |
123 IDS_SHARE_CONFIRM_DIALOG_MESSAGE_WITH_USERNAME), | 123 IDS_SHARE_CONFIRM_DIALOG_MESSAGE_WITH_USERNAME), |
124 remote_user_email); | 124 remote_user_email); |
125 GtkWidget* text_label = gtk_label_new(base::UTF16ToUTF8(dialog_text).c_str()); | 125 GtkWidget* text_label = gtk_label_new(base::UTF16ToUTF8(dialog_text).c_str()); |
126 gtk_label_set_line_wrap(GTK_LABEL(text_label), true); | 126 gtk_label_set_line_wrap(GTK_LABEL(text_label), true); |
| 127 G_GNUC_BEGIN_IGNORE_DEPRECATIONS; |
127 gtk_misc_set_padding(GTK_MISC(text_label), 12, 12); | 128 gtk_misc_set_padding(GTK_MISC(text_label), 12, 12); |
| 129 G_GNUC_END_IGNORE_DEPRECATIONS; |
128 | 130 |
129 gtk_container_add(GTK_CONTAINER(content_area), text_label); | 131 gtk_container_add(GTK_CONTAINER(content_area), text_label); |
130 gtk_widget_show_all(content_area); | 132 gtk_widget_show_all(content_area); |
131 | 133 |
132 gtk_window_set_urgency_hint(GTK_WINDOW(confirmation_window_), true); | 134 gtk_window_set_urgency_hint(GTK_WINDOW(confirmation_window_), true); |
133 gtk_window_present(GTK_WINDOW(confirmation_window_)); | 135 gtk_window_present(GTK_WINDOW(confirmation_window_)); |
134 } | 136 } |
135 | 137 |
136 void It2MeConfirmationDialogLinux::OnResponse(GtkDialog* dialog, | 138 void It2MeConfirmationDialogLinux::OnResponse(GtkDialog* dialog, |
137 int response_id) { | 139 int response_id) { |
138 DCHECK(result_callback_); | 140 DCHECK(result_callback_); |
139 | 141 |
140 Hide(); | 142 Hide(); |
141 base::ResetAndReturn(&result_callback_).Run( | 143 base::ResetAndReturn(&result_callback_).Run( |
142 (response_id == GTK_RESPONSE_OK) ? Result::OK : Result::CANCEL); | 144 (response_id == GTK_RESPONSE_OK) ? Result::OK : Result::CANCEL); |
143 } | 145 } |
144 | 146 |
145 } // namespace | 147 } // namespace |
146 | 148 |
147 // static | 149 // static |
148 std::unique_ptr<It2MeConfirmationDialog> It2MeConfirmationDialog::Create() { | 150 std::unique_ptr<It2MeConfirmationDialog> It2MeConfirmationDialog::Create() { |
149 return base::MakeUnique<It2MeConfirmationDialogLinux>(); | 151 return base::MakeUnique<It2MeConfirmationDialogLinux>(); |
150 } | 152 } |
151 | 153 |
152 } // namespace remoting | 154 } // namespace remoting |
OLD | NEW |