Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: remoting/host/disconnect_window_linux.cc

Issue 7669045: Make ChromotingHost::ui_strings() immutable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/disconnect_window.h ('k') | remoting/host/plugin/host_script_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/disconnect_window_linux.cc
diff --git a/remoting/host/disconnect_window_linux.cc b/remoting/host/disconnect_window_linux.cc
index ad2707d9f789da6cafbbd2149cf6882d70089583..b2dd6f5e06739d26015740d255e6b8be0410484f 100644
--- a/remoting/host/disconnect_window_linux.cc
+++ b/remoting/host/disconnect_window_linux.cc
@@ -8,6 +8,8 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
#include "remoting/host/chromoting_host.h"
#include "remoting/host/ui_strings.h"
#include "ui/base/gtk/gtk_signal.h"
@@ -36,7 +38,7 @@ class DisconnectWindowLinux : public DisconnectWindow {
private:
CHROMEGTK_CALLBACK_1(DisconnectWindowLinux, void, OnResponse, int);
- void CreateWindow(UiStrings* ui_strings);
+ void CreateWindow(const UiStrings& ui_strings);
ChromotingHost* host_;
GtkWidget* disconnect_window_;
@@ -53,14 +55,15 @@ DisconnectWindowLinux::DisconnectWindowLinux()
DisconnectWindowLinux::~DisconnectWindowLinux() {
}
-void DisconnectWindowLinux::CreateWindow(UiStrings* ui_strings) {
+void DisconnectWindowLinux::CreateWindow(const UiStrings& ui_strings) {
if (disconnect_window_) return;
disconnect_window_ = gtk_dialog_new_with_buttons(
- ui_strings->product_name.c_str(),
+ UTF16ToUTF8(ui_strings.product_name).c_str(),
NULL,
GTK_DIALOG_NO_SEPARATOR,
- ui_strings->disconnect_button_text_plus_shortcut.c_str(), GTK_RESPONSE_OK,
+ UTF16ToUTF8(ui_strings.disconnect_button_text_plus_shortcut).c_str(),
+ GTK_RESPONSE_OK,
NULL);
GtkWindow* window = GTK_WINDOW(disconnect_window_);
@@ -94,11 +97,13 @@ void DisconnectWindowLinux::CreateWindow(UiStrings* ui_strings) {
}
void DisconnectWindowLinux::Show(ChromotingHost* host,
- const std::string& /* unused */) {
+ const std::string& username) {
host_ = host;
CreateWindow(host->ui_strings());
- gtk_label_set_text(GTK_LABEL(message_),
- host->ui_strings()->disconnect_message.c_str());
+
+ string16 text = ReplaceStringPlaceholders(
+ host->ui_strings().disconnect_message, UTF8ToUTF16(username), NULL);
+ gtk_label_set_text(GTK_LABEL(message_), UTF16ToUTF8(text).c_str());
gtk_window_present(GTK_WINDOW(disconnect_window_));
}
« no previous file with comments | « remoting/host/disconnect_window.h ('k') | remoting/host/plugin/host_script_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698