| 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 "remoting/host/continue_window.h" | 5 #include "remoting/host/continue_window.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 g_signal_connect(continue_window_, "response", | 95 g_signal_connect(continue_window_, "response", |
| 96 G_CALLBACK(OnResponseThunk), this); | 96 G_CALLBACK(OnResponseThunk), this); |
| 97 | 97 |
| 98 GtkWidget* content_area = | 98 GtkWidget* content_area = |
| 99 gtk_dialog_get_content_area(GTK_DIALOG(continue_window_)); | 99 gtk_dialog_get_content_area(GTK_DIALOG(continue_window_)); |
| 100 | 100 |
| 101 GtkWidget* text_label = | 101 GtkWidget* text_label = |
| 102 gtk_label_new(l10n_util::GetStringUTF8(IDS_CONTINUE_PROMPT).c_str()); | 102 gtk_label_new(l10n_util::GetStringUTF8(IDS_CONTINUE_PROMPT).c_str()); |
| 103 gtk_label_set_line_wrap(GTK_LABEL(text_label), TRUE); | 103 gtk_label_set_line_wrap(GTK_LABEL(text_label), TRUE); |
| 104 // TODO(lambroslambrou): Fix magic numbers, as in disconnect_window_gtk.cc. | 104 // TODO(lambroslambrou): Fix magic numbers, as in disconnect_window_gtk.cc. |
| 105 G_GNUC_BEGIN_IGNORE_DEPRECATIONS; |
| 105 gtk_misc_set_padding(GTK_MISC(text_label), 12, 12); | 106 gtk_misc_set_padding(GTK_MISC(text_label), 12, 12); |
| 107 G_GNUC_END_IGNORE_DEPRECATIONS; |
| 106 gtk_container_add(GTK_CONTAINER(content_area), text_label); | 108 gtk_container_add(GTK_CONTAINER(content_area), text_label); |
| 107 | 109 |
| 108 gtk_widget_show_all(content_area); | 110 gtk_widget_show_all(content_area); |
| 109 } | 111 } |
| 110 | 112 |
| 111 void ContinueWindowGtk::OnResponse(GtkDialog* dialog, int response_id) { | 113 void ContinueWindowGtk::OnResponse(GtkDialog* dialog, int response_id) { |
| 112 DCHECK(CalledOnValidThread()); | 114 DCHECK(CalledOnValidThread()); |
| 113 | 115 |
| 114 if (response_id == GTK_RESPONSE_OK) { | 116 if (response_id == GTK_RESPONSE_OK) { |
| 115 ContinueSession(); | 117 ContinueSession(); |
| 116 } else { | 118 } else { |
| 117 DisconnectSession(); | 119 DisconnectSession(); |
| 118 } | 120 } |
| 119 | 121 |
| 120 HideUi(); | 122 HideUi(); |
| 121 } | 123 } |
| 122 | 124 |
| 123 // static | 125 // static |
| 124 std::unique_ptr<HostWindow> HostWindow::CreateContinueWindow() { | 126 std::unique_ptr<HostWindow> HostWindow::CreateContinueWindow() { |
| 125 return base::MakeUnique<ContinueWindowGtk>(); | 127 return base::MakeUnique<ContinueWindowGtk>(); |
| 126 } | 128 } |
| 127 | 129 |
| 128 } // namespace remoting | 130 } // namespace remoting |
| OLD | NEW |