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.h | |
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.h')
-rw-r--r-- | remoting/host/ui_strings.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/remoting/host/ui_strings.h b/remoting/host/ui_strings.h index c06140f..bdd0c4a 100644 --- a/remoting/host/ui_strings.h +++ b/remoting/host/ui_strings.h @@ -5,7 +5,7 @@ #ifndef REMOTING_HOST_UI_STRINGS_H_ #define REMOTING_HOST_UI_STRINGS_H_ -#include <string> +#include "base/string16.h" // This struct contains localized strings to be displayed in host dialogs. // For the web-app, these are loaded from the appropriate messages.json @@ -27,28 +27,25 @@ struct UiStrings { Direction direction; // The product name (Chromoting or Chrome Remote Desktop). - std::string product_name; + string16 product_name; // The message in the disconnect dialog. - std::string disconnect_message; + string16 disconnect_message; // The label on the disconnect dialog button, without the keyboard shortcut. - std::string disconnect_button_text; + string16 disconnect_button_text; // The label on the disconnect dialog button, with the keyboard shortcut. - std::string disconnect_button_text_plus_shortcut; - - // The keyboard shortcut for disconnecting clients. - std::string disconnect_button_shortcut; + string16 disconnect_button_text_plus_shortcut; // The confirmation prompt displayed by the continue window. - std::string continue_prompt; + string16 continue_prompt; // The label on the 'Continue' button of the continue window. - std::string continue_button_text; + string16 continue_button_text; // The label on the 'Stop Sharing' button of the continue window. - std::string stop_sharing_button_text; + string16 stop_sharing_button_text; }; } |