diff options
author | nkostylev@google.com <nkostylev@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 10:00:06 +0000 |
---|---|---|
committer | nkostylev@google.com <nkostylev@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 10:00:06 +0000 |
commit | 743680143e148a82e7ecd23f38f80fde39e6ba3b (patch) | |
tree | 62c964e200dbeca701224443f5fe658ae8f93f0f /chrome/browser/chromeos | |
parent | 460fdb1228bfd53bb483f882956dd2e66df1d83e (diff) | |
download | chromium_src-743680143e148a82e7ecd23f38f80fde39e6ba3b.zip chromium_src-743680143e148a82e7ecd23f38f80fde39e6ba3b.tar.gz chromium_src-743680143e148a82e7ecd23f38f80fde39e6ba3b.tar.bz2 |
Refresh network combobox on locale change.
BUG= http://crosbug.com/3162
TEST=Change UI language on welcome screen. Combobox should show "No selection" message when network hasn't been selected previously.
Review URL: http://codereview.chromium.org/2011014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47132 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r-- | chrome/browser/chromeos/login/network_screen.cc | 6 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/network_selection_view.cc | 11 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/network_selection_view.h | 1 |
3 files changed, 11 insertions, 7 deletions
diff --git a/chrome/browser/chromeos/login/network_screen.cc b/chrome/browser/chromeos/login/network_screen.cc index 4e50e6e..6a4e9ed 100644 --- a/chrome/browser/chromeos/login/network_screen.cc +++ b/chrome/browser/chromeos/login/network_screen.cc @@ -60,12 +60,6 @@ void NetworkScreen::ItemChanged(views::Combobox* sender, if (new_index == prev_index || new_index < 0 || prev_index < 0) return; - // First item is a text, not a network. - if (new_index == 0) { - view()->SetSelectedNetworkItem(prev_index); - return; - } - if (networks_.IsEmpty()) return; diff --git a/chrome/browser/chromeos/login/network_selection_view.cc b/chrome/browser/chromeos/login/network_selection_view.cc index c822e68..55a50b5 100644 --- a/chrome/browser/chromeos/login/network_selection_view.cc +++ b/chrome/browser/chromeos/login/network_selection_view.cc @@ -128,9 +128,19 @@ void NetworkSelectionView::UpdateLocalizedStrings() { //////////////////////////////////////////////////////////////////////////////// // views::View: implementation: +void NetworkSelectionView::ChildPreferredSizeChanged(View* child) { + Layout(); + SchedulePaint(); +} + void NetworkSelectionView::LocaleChanged() { UpdateLocalizedStrings(); NetworkModelChanged(); + // Explicitly set selected item - index 0 is a localized string. + if (GetSelectedNetworkItem() <= 0 && + delegate_->GetItemCount() > 0) { + SetSelectedNetworkItem(0); + } Layout(); SchedulePaint(); } @@ -192,7 +202,6 @@ 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 56b60b2..ad52878 100644 --- a/chrome/browser/chromeos/login/network_selection_view.h +++ b/chrome/browser/chromeos/login/network_selection_view.h @@ -54,6 +54,7 @@ class NetworkSelectionView : public views::View { protected: // Overridden from views::View. + virtual void ChildPreferredSizeChanged(View* child); virtual void LocaleChanged(); private: |