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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
6 #include <math.h> | 6 #include <math.h> |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 PangoAttribute* text_color = pango_attr_foreground_new(0, 0, 0); | 154 PangoAttribute* text_color = pango_attr_foreground_new(0, 0, 0); |
155 pango_attr_list_insert(attributes, text_color); | 155 pango_attr_list_insert(attributes, text_color); |
156 gtk_label_set_attributes(GTK_LABEL(message_), attributes); | 156 gtk_label_set_attributes(GTK_LABEL(message_), attributes); |
157 pango_attr_list_unref(attributes); | 157 pango_attr_list_unref(attributes); |
158 | 158 |
159 gtk_widget_show_all(disconnect_window_); | 159 gtk_widget_show_all(disconnect_window_); |
160 | 160 |
161 // Extract the user name from the JID. | 161 // Extract the user name from the JID. |
162 std::string client_jid = client_session_control_->client_jid(); | 162 std::string client_jid = client_session_control_->client_jid(); |
163 base::string16 username = | 163 base::string16 username = |
164 UTF8ToUTF16(client_jid.substr(0, client_jid.find('/'))); | 164 base::UTF8ToUTF16(client_jid.substr(0, client_jid.find('/'))); |
165 gtk_label_set_text( | 165 gtk_label_set_text( |
166 GTK_LABEL(message_), | 166 GTK_LABEL(message_), |
167 l10n_util::GetStringFUTF8(IDR_MESSAGE_SHARED, username).c_str()); | 167 l10n_util::GetStringFUTF8(IDR_MESSAGE_SHARED, username).c_str()); |
168 gtk_window_present(window); | 168 gtk_window_present(window); |
169 } | 169 } |
170 | 170 |
171 void DisconnectWindowGtk::OnClicked(GtkWidget* button) { | 171 void DisconnectWindowGtk::OnClicked(GtkWidget* button) { |
172 DCHECK(CalledOnValidThread()); | 172 DCHECK(CalledOnValidThread()); |
173 | 173 |
174 if (client_session_control_.get()) | 174 if (client_session_control_.get()) |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 285 } |
286 | 286 |
287 } // namespace | 287 } // namespace |
288 | 288 |
289 // static | 289 // static |
290 scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { | 290 scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { |
291 return scoped_ptr<HostWindow>(new DisconnectWindowGtk()); | 291 return scoped_ptr<HostWindow>(new DisconnectWindowGtk()); |
292 } | 292 } |
293 | 293 |
294 } // namespace remoting | 294 } // namespace remoting |
OLD | NEW |