diff options
author | glotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-20 18:22:12 +0000 |
---|---|---|
committer | glotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-20 18:22:12 +0000 |
commit | 7ceeba70872aab6ac66a1043c9f1587b12fc6710 (patch) | |
tree | b1b31bd92c42eee3987a970246107772d3eda4b7 /chrome | |
parent | a6bab42a4a8f87d60fd0b5772d4fb6e14381853a (diff) | |
download | chromium_src-7ceeba70872aab6ac66a1043c9f1587b12fc6710.zip chromium_src-7ceeba70872aab6ac66a1043c9f1587b12fc6710.tar.gz chromium_src-7ceeba70872aab6ac66a1043c9f1587b12fc6710.tar.bz2 |
UI Language switch implemented by propagating LocaleChanged()
notification to all the views currently active.
Before this CL, all views were recreated instead. That was very refactoring-unsafe.
Note, this is first part of the change. It prepares overall architecture means and can be committed first.
The other part contains implementation details and is here: http://codereview.chromium.org/1551029/show
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1596023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45057 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chromeos/login/network_selection_view.cc | 12 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/network_selection_view.h | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/login/network_selection_view.cc b/chrome/browser/chromeos/login/network_selection_view.cc index ed3ff91..baa324e 100644 --- a/chrome/browser/chromeos/login/network_selection_view.cc +++ b/chrome/browser/chromeos/login/network_selection_view.cc @@ -91,14 +91,14 @@ void NetworkSelectionView::Init() { offline_button_ = new views::NativeButton(delegate_, std::wstring()); offline_button_->set_font(button_font); - UpdateLocalizedStrings(); - AddChildView(welcome_label_); AddChildView(select_network_label_); AddChildView(connecting_network_label_); AddChildView(network_combobox_); AddChildView(languages_menubutton_); AddChildView(offline_button_); + + UpdateLocalizedStrings(); } void NetworkSelectionView::UpdateLocalizedStrings() { @@ -116,6 +116,13 @@ void NetworkSelectionView::UpdateLocalizedStrings() { //////////////////////////////////////////////////////////////////////////////// // views::View: implementation: +void NetworkSelectionView::LocaleChanged() { + UpdateLocalizedStrings(); + NetworkModelChanged(); + Layout(); + SchedulePaint(); +} + gfx::Size NetworkSelectionView::GetPreferredSize() { return gfx::Size(width(), height()); } @@ -163,6 +170,7 @@ void NetworkSelectionView::Layout() { // Need to refresh combobox layout explicitly. network_combobox_->Layout(); + offline_button_->Layout(); SchedulePaint(); } diff --git a/chrome/browser/chromeos/login/network_selection_view.h b/chrome/browser/chromeos/login/network_selection_view.h index f8d134f..268453b 100644 --- a/chrome/browser/chromeos/login/network_selection_view.h +++ b/chrome/browser/chromeos/login/network_selection_view.h @@ -51,6 +51,10 @@ class NetworkSelectionView : public views::View { // Shows network connecting status or network selection otherwise. void ShowConnectingStatus(bool connecting, const string16& network_id); + protected: + // Overridden from views::View. + virtual void LocaleChanged(); + private: // Updates text on label with currently connecting network. void UpdateConnectingNetworkLabel(); |