diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-18 22:19:23 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-18 22:19:23 +0000 |
commit | 8b65ba9961e94706d8b0833638d0ef99b95b3b43 (patch) | |
tree | 1ccb150aee4b1a1ef414cf4a2d474f977b7d1e71 /remoting/host/ui_strings.cc | |
parent | 352a797d3022450c4e5ee0e25a7d30cb414632da (diff) | |
download | chromium_src-8b65ba9961e94706d8b0833638d0ef99b95b3b43.zip chromium_src-8b65ba9961e94706d8b0833638d0ef99b95b3b43.tar.gz chromium_src-8b65ba9961e94706d8b0833638d0ef99b95b3b43.tar.bz2 |
Make ChromotingHost::ui_strings() immutable. Use string16 for localized strings.
There were two issues:
- ui_strings() were mutable which creates possibility for race
condition. Made it immutable, and added SetUiString() which can be
called only before session is started.
- strings were loaded after host is started which sometimes leads to
non-localized string being shown. Particularly I often saw empty
text on Disconnect button.
BUG=None
TEST=Disconnect button text is always localized.
Review URL: http://codereview.chromium.org/7669045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97376 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/ui_strings.cc')
-rw-r--r-- | remoting/host/ui_strings.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/remoting/host/ui_strings.cc b/remoting/host/ui_strings.cc index 760643f..99c59b3 100644 --- a/remoting/host/ui_strings.cc +++ b/remoting/host/ui_strings.cc @@ -4,24 +4,26 @@ #include "remoting/host/ui_strings.h" +#include "base/utf_string_conversions.h" + namespace remoting { UiStrings::UiStrings() : direction(LTR), - product_name("Chromoting"), - // The default string doesn't include the user name, so this will be - // missing for remoting_simple_host - disconnect_message("Your desktop is currently being shared."), - disconnect_button_text("Disconnect"), + product_name(ASCIIToUTF16("Chromoting")), + disconnect_message( + ASCIIToUTF16("Your desktop is currently being shared with $1.")), + disconnect_button_text(ASCIIToUTF16("Disconnect")), // This is the wrong shortcut on Mac OS X, but remoting_simple_host // doesn't have a bundle (and hence no dialog) on that platform and // the web-app will provide the correct localization for this string. - disconnect_button_shortcut("Ctrl+Alt+Esc"), - continue_prompt( + disconnect_button_text_plus_shortcut( + ASCIIToUTF16("Disconnect (Ctrl+Alt+Esc)")), + continue_prompt(ASCIIToUTF16( "You are currently sharing this machine with another user. " - "Please confirm that you want to continue sharing."), - continue_button_text("Continue"), - stop_sharing_button_text("Stop Sharing") { + "Please confirm that you want to continue sharing.")), + continue_button_text(ASCIIToUTF16("Continue")), + stop_sharing_button_text(ASCIIToUTF16("Stop Sharing")) { } UiStrings::~UiStrings() { } |