| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/network_selection_view.h" | 5 #include "chrome/browser/chromeos/login/network_selection_view.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 proxy_settings_link_->SetHighlightedColor(login::kLinkColor); | 327 proxy_settings_link_->SetHighlightedColor(login::kLinkColor); |
| 328 | 328 |
| 329 UpdateLocalizedStrings(); | 329 UpdateLocalizedStrings(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 void NetworkSelectionView::UpdateLocalizedStrings() { | 332 void NetworkSelectionView::UpdateLocalizedStrings() { |
| 333 languages_menubutton_->SetText( | 333 languages_menubutton_->SetText( |
| 334 UTF16ToWide(delegate_->language_switch_menu()->GetCurrentLocaleName())); | 334 UTF16ToWide(delegate_->language_switch_menu()->GetCurrentLocaleName())); |
| 335 keyboards_menubutton_->SetText( | 335 keyboards_menubutton_->SetText( |
| 336 UTF16ToWide(delegate_->keyboard_switch_menu()->GetCurrentKeyboardName())); | 336 UTF16ToWide(delegate_->keyboard_switch_menu()->GetCurrentKeyboardName())); |
| 337 welcome_label_->SetText(l10n_util::GetString(IDS_NETWORK_SELECTION_TITLE)); | 337 welcome_label_->SetText( |
| 338 UTF16ToWide(l10n_util::GetStringUTF16(IDS_NETWORK_SELECTION_TITLE))); |
| 338 select_language_label_->SetText( | 339 select_language_label_->SetText( |
| 339 l10n_util::GetString(IDS_LANGUAGE_SELECTION_SELECT)); | 340 UTF16ToWide(l10n_util::GetStringUTF16(IDS_LANGUAGE_SELECTION_SELECT))); |
| 340 select_keyboard_label_->SetText( | 341 select_keyboard_label_->SetText( |
| 341 l10n_util::GetString(IDS_KEYBOARD_SELECTION_SELECT)); | 342 UTF16ToWide(l10n_util::GetStringUTF16(IDS_KEYBOARD_SELECTION_SELECT))); |
| 342 select_network_label_->SetText( | 343 select_network_label_->SetText( |
| 343 l10n_util::GetString(IDS_NETWORK_SELECTION_SELECT)); | 344 UTF16ToWide(l10n_util::GetStringUTF16(IDS_NETWORK_SELECTION_SELECT))); |
| 344 proxy_settings_link_->SetText( | 345 proxy_settings_link_->SetText(UTF16ToWide( |
| 345 l10n_util::GetString(IDS_OPTIONS_PROXIES_CONFIGURE_BUTTON)); | 346 l10n_util::GetStringUTF16(IDS_OPTIONS_PROXIES_CONFIGURE_BUTTON))); |
| 346 RecreateNativeControls(); | 347 RecreateNativeControls(); |
| 347 UpdateConnectingNetworkLabel(); | 348 UpdateConnectingNetworkLabel(); |
| 348 network_dropdown_->Refresh(); | 349 network_dropdown_->Refresh(); |
| 349 InitLayout(); | 350 InitLayout(); |
| 350 } | 351 } |
| 351 | 352 |
| 352 //////////////////////////////////////////////////////////////////////////////// | 353 //////////////////////////////////////////////////////////////////////////////// |
| 353 // views::View: implementation: | 354 // views::View: implementation: |
| 354 | 355 |
| 355 bool NetworkSelectionView::OnKeyPressed(const views::KeyEvent&) { | 356 bool NetworkSelectionView::OnKeyPressed(const views::KeyEvent&) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 //////////////////////////////////////////////////////////////////////////////// | 442 //////////////////////////////////////////////////////////////////////////////// |
| 442 // NetworkSelectionView, private: | 443 // NetworkSelectionView, private: |
| 443 | 444 |
| 444 void NetworkSelectionView::RecreateNativeControls() { | 445 void NetworkSelectionView::RecreateNativeControls() { |
| 445 // There is no way to get native button preferred size after the button was | 446 // There is no way to get native button preferred size after the button was |
| 446 // sized so delete and recreate the button on text update. | 447 // sized so delete and recreate the button on text update. |
| 447 bool is_continue_enabled = IsContinueEnabled(); | 448 bool is_continue_enabled = IsContinueEnabled(); |
| 448 delete continue_button_; | 449 delete continue_button_; |
| 449 continue_button_ = new login::WideButton( | 450 continue_button_ = new login::WideButton( |
| 450 delegate_, | 451 delegate_, |
| 451 l10n_util::GetString(IDS_NETWORK_SELECTION_CONTINUE_BUTTON)); | 452 UTF16ToWide( |
| 453 l10n_util::GetStringUTF16(IDS_NETWORK_SELECTION_CONTINUE_BUTTON))); |
| 452 continue_button_->SetEnabled(is_continue_enabled); | 454 continue_button_->SetEnabled(is_continue_enabled); |
| 453 } | 455 } |
| 454 | 456 |
| 455 void NetworkSelectionView::UpdateConnectingNetworkLabel() { | 457 void NetworkSelectionView::UpdateConnectingNetworkLabel() { |
| 456 connecting_network_label_->SetText(l10n_util::GetStringF( | 458 connecting_network_label_->SetText(UTF16ToWide(l10n_util::GetStringFUTF16( |
| 457 IDS_NETWORK_SELECTION_CONNECTING, UTF16ToWide(network_id_))); | 459 IDS_NETWORK_SELECTION_CONNECTING, network_id_))); |
| 458 } | 460 } |
| 459 | 461 |
| 460 } // namespace chromeos | 462 } // namespace chromeos |
| OLD | NEW |