Chromium Code Reviews| Index: remoting/host/plugin/host_script_object.cc |
| diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc |
| index 9f6bbfcea19ab54ac2c91674ea90493202dc53c7..ec3b94b0b3c9f554d1a079e5f9cd488c8a7c7384 100644 |
| --- a/remoting/host/plugin/host_script_object.cc |
| +++ b/remoting/host/plugin/host_script_object.cc |
| @@ -350,7 +350,6 @@ void HostNPScriptObject::OnClientAuthenticated( |
| if (pos != std::string::npos) |
| client_username_.replace(pos, std::string::npos, ""); |
| LOG(INFO) << "Client " << client_username_ << " connected."; |
| - LocalizeStrings(); |
| OnStateChanged(kConnected); |
| } |
| @@ -482,6 +481,8 @@ void HostNPScriptObject::FinishConnect( |
| host_->AddStatusObserver(register_request_.get()); |
| host_->set_it2me(true); |
| + LocalizeStrings(); |
|
Jamie
2011/08/18 16:28:41
Do we know the username at this point? Your object
Sergey Ulanov
2011/08/18 18:04:32
I updated DisconnectWindow to substitute user name
|
| + |
| // Start the Host. |
| host_->Start(); |
| @@ -642,14 +643,14 @@ void HostNPScriptObject::SetException(const std::string& exception_string) { |
| } |
| void HostNPScriptObject::LocalizeStrings() { |
| - UiStrings* ui_strings = host_->ui_strings(); |
| + UiStrings ui_strings; |
| std::string direction; |
| LocalizeString("@@bidi_dir", NULL, &direction); |
| - ui_strings->direction = |
| + ui_strings.direction = |
| direction == "rtl" ? remoting::UiStrings::RTL |
| : remoting::UiStrings::LTR; |
| - LocalizeString("productName", NULL, &ui_strings->product_name); |
| - LocalizeString("disconnectButton", NULL, &ui_strings->disconnect_button_text); |
| + LocalizeString("productName", NULL, &ui_strings.product_name); |
| + LocalizeString("disconnectButton", NULL, &ui_strings.disconnect_button_text); |
| LocalizeString( |
| #if defined(OS_WIN) |
| "disconnectButtonPlusShortcutWindows", |
| @@ -658,13 +659,15 @@ void HostNPScriptObject::LocalizeStrings() { |
| #else |
| "disconnectButtonPlusShortcutLinux", |
| #endif |
| - NULL, &ui_strings->disconnect_button_text_plus_shortcut); |
| - LocalizeString("continuePrompt", NULL, &ui_strings->continue_prompt); |
| - LocalizeString("continueButton", NULL, &ui_strings->continue_button_text); |
| + NULL, &ui_strings.disconnect_button_text_plus_shortcut); |
| + LocalizeString("continuePrompt", NULL, &ui_strings.continue_prompt); |
| + LocalizeString("continueButton", NULL, &ui_strings.continue_button_text); |
| LocalizeString("stopSharingButton", NULL, |
| - &ui_strings->stop_sharing_button_text); |
| + &ui_strings.stop_sharing_button_text); |
| LocalizeString("messageShared", client_username_.c_str(), |
| - &ui_strings->disconnect_message); |
| + &ui_strings.disconnect_message); |
| + |
| + host_->SetUiStrings(ui_strings); |
| } |
| bool HostNPScriptObject::LocalizeString(const char* tag, |