Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/browser/chromeos/options/language_config_view.cc

Issue 6156001: Remove wstring from l10n_util. Part 8, the last part.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/options/language_config_view.h" 5 #include "chrome/browser/chromeos/options/language_config_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 prefs->SetString(prefs::kApplicationLocale, button->language_code()); 173 prefs->SetString(prefs::kApplicationLocale, button->language_code());
174 prefs->SavePersistentPrefs(); 174 prefs->SavePersistentPrefs();
175 RestartMessageBox::ShowMessageBox(GetWindow()->GetNativeWindow()); 175 RestartMessageBox::ShowMessageBox(GetWindow()->GetNativeWindow());
176 } 176 }
177 } 177 }
178 } 178 }
179 179
180 std::wstring LanguageConfigView::GetDialogButtonLabel( 180 std::wstring LanguageConfigView::GetDialogButtonLabel(
181 MessageBoxFlags::DialogButton button) const { 181 MessageBoxFlags::DialogButton button) const {
182 if (button == MessageBoxFlags::DIALOGBUTTON_OK) { 182 if (button == MessageBoxFlags::DIALOGBUTTON_OK) {
183 return l10n_util::GetString(IDS_DONE); 183 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_DONE));
184 } 184 }
185 return L""; 185 return L"";
186 } 186 }
187 187
188 std::wstring LanguageConfigView::GetWindowTitle() const { 188 std::wstring LanguageConfigView::GetWindowTitle() const {
189 return l10n_util::GetString( 189 return UTF16ToWide(l10n_util::GetStringUTF16(
190 IDS_OPTIONS_SETTINGS_LANGUAGES_DIALOG_TITLE); 190 IDS_OPTIONS_SETTINGS_LANGUAGES_DIALOG_TITLE));
191 } 191 }
192 192
193 void LanguageConfigView::Layout() { 193 void LanguageConfigView::Layout() {
194 // Not sure why but this is needed to show contents in the dialog. 194 // Not sure why but this is needed to show contents in the dialog.
195 root_container_->SetBounds(0, 0, width(), height()); 195 root_container_->SetBounds(0, 0, width(), height());
196 } 196 }
197 197
198 gfx::Size LanguageConfigView::GetPreferredSize() { 198 gfx::Size LanguageConfigView::GetPreferredSize() {
199 return gfx::Size(views::Window::GetLocalizedContentsSize( 199 return gfx::Size(views::Window::GetLocalizedContentsSize(
200 IDS_LANGUAGES_INPUT_DIALOG_WIDTH_CHARS, 200 IDS_LANGUAGES_INPUT_DIALOG_WIDTH_CHARS,
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 true); 459 true);
460 } 460 }
461 // Create the add language combobox. 461 // Create the add language combobox.
462 add_language_combobox_ 462 add_language_combobox_
463 = new views::Combobox(add_language_combobox_model_.get()); 463 = new views::Combobox(add_language_combobox_model_.get());
464 add_language_combobox_->set_listener(this); 464 add_language_combobox_->set_listener(this);
465 ResetAddLanguageCombobox(); 465 ResetAddLanguageCombobox();
466 466
467 // Create the remove button. 467 // Create the remove button.
468 remove_language_button_ = new views::NativeButton( 468 remove_language_button_ = new views::NativeButton(
469 this, l10n_util::GetString( 469 this, UTF16ToWide(l10n_util::GetStringUTF16(
470 IDS_OPTIONS_SETTINGS_LANGUAGES_REMOVE_BUTTON)); 470 IDS_OPTIONS_SETTINGS_LANGUAGES_REMOVE_BUTTON)));
471 remove_language_button_->set_tag(kRemoveLanguageButton); 471 remove_language_button_->set_tag(kRemoveLanguageButton);
472 472
473 // Add the add and remove buttons. 473 // Add the add and remove buttons.
474 layout->StartRow(0, kButtonsColumnSetId); 474 layout->StartRow(0, kButtonsColumnSetId);
475 layout->AddView(add_language_combobox_); 475 layout->AddView(add_language_combobox_);
476 layout->AddView(remove_language_button_); 476 layout->AddView(remove_language_button_);
477 477
478 return contents; 478 return contents;
479 } 479 }
480 480
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 523
524 // Add the language name label. 524 // Add the language name label.
525 layout->StartRow(0, kPerLanguageTitleColumnSetId); 525 layout->StartRow(0, kPerLanguageTitleColumnSetId);
526 layout->AddView(language_name_label); 526 layout->AddView(language_name_label);
527 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); 527 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
528 528
529 layout->StartRow(0, kPerLanguageSingleColumnSetId); 529 layout->StartRow(0, kPerLanguageSingleColumnSetId);
530 if (application_locale == language_code) { 530 if (application_locale == language_code) {
531 layout->AddView( 531 layout->AddView(
532 new views::Label( 532 new views::Label(
533 l10n_util::GetStringF( 533 UTF16ToWide(l10n_util::GetStringFUTF16(
534 IDS_OPTIONS_SETTINGS_LANGUAGES_IS_DISPLAYED_IN_THIS_LANGUAGE, 534 IDS_OPTIONS_SETTINGS_LANGUAGES_IS_DISPLAYED_IN_THIS_LANGUAGE,
535 l10n_util::GetString(IDS_PRODUCT_OS_NAME)))); 535 l10n_util::GetStringUTF16(IDS_PRODUCT_OS_NAME)))));
536 } else { 536 } else {
537 UiLanguageButton* button = new UiLanguageButton( 537 UiLanguageButton* button = new UiLanguageButton(
538 this, l10n_util::GetStringF( 538 this, UTF16ToWide(l10n_util::GetStringFUTF16(
539 IDS_OPTIONS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE, 539 IDS_OPTIONS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE,
540 l10n_util::GetString(IDS_PRODUCT_OS_NAME)), 540 l10n_util::GetStringUTF16(IDS_PRODUCT_OS_NAME))),
541 language_code); 541 language_code);
542 button->set_tag(kChangeUiLanguageButton); 542 button->set_tag(kChangeUiLanguageButton);
543 layout->AddView(button); 543 layout->AddView(button);
544 } 544 }
545 } 545 }
546 546
547 void LanguageConfigView::AddInputMethodSection( 547 void LanguageConfigView::AddInputMethodSection(
548 const std::string& language_code, 548 const std::string& language_code,
549 views::GridLayout* layout) { 549 views::GridLayout* layout) {
550 // Create the input method title label. 550 // Create the input method title label.
551 views::Label* input_method_title_label = new views::Label( 551 views::Label* input_method_title_label = new views::Label(
552 l10n_util::GetString( 552 UTF16ToWide(l10n_util::GetStringUTF16(
553 IDS_OPTIONS_SETTINGS_LANGUAGES_INPUT_METHOD)); 553 IDS_OPTIONS_SETTINGS_LANGUAGES_INPUT_METHOD)));
554 input_method_title_label->SetFont( 554 input_method_title_label->SetFont(
555 input_method_title_label->font().DeriveFont(0, gfx::Font::BOLD)); 555 input_method_title_label->font().DeriveFont(0, gfx::Font::BOLD));
556 556
557 // Add the input method title label. 557 // Add the input method title label.
558 layout->StartRow(0, kPerLanguageTitleColumnSetId); 558 layout->StartRow(0, kPerLanguageTitleColumnSetId);
559 layout->AddView(input_method_title_label); 559 layout->AddView(input_method_title_label);
560 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); 560 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
561 561
562 // Add input method names and configuration buttons. 562 // Add input method names and configuration buttons.
563 input_method_checkboxes_.clear(); 563 input_method_checkboxes_.clear();
(...skipping 16 matching lines...) Expand all
580 checkbox->SetChecked(true); 580 checkbox->SetChecked(true);
581 } 581 }
582 582
583 layout->AddView(checkbox); 583 layout->AddView(checkbox);
584 input_method_checkboxes_.insert(checkbox); 584 input_method_checkboxes_.insert(checkbox);
585 // Add "configure" button for the input method if we have a 585 // Add "configure" button for the input method if we have a
586 // configuration dialog for it. 586 // configuration dialog for it.
587 if (input_method_config_view_map_.count(input_method_id) > 0) { 587 if (input_method_config_view_map_.count(input_method_id) > 0) {
588 InputMethodButton* button = new InputMethodButton( 588 InputMethodButton* button = new InputMethodButton(
589 this, 589 this,
590 l10n_util::GetString(IDS_OPTIONS_SETTINGS_LANGUAGES_CONFIGURE), 590 UTF16ToWide(l10n_util::GetStringUTF16(
591 IDS_OPTIONS_SETTINGS_LANGUAGES_CONFIGURE)),
591 input_method_id); 592 input_method_id);
592 button->set_tag(kConfigureInputMethodButton); 593 button->set_tag(kConfigureInputMethodButton);
593 layout->AddView(button); 594 layout->AddView(button);
594 } 595 }
595 } 596 }
596 } 597 }
597 598
598 views::DialogDelegate* LanguageConfigView::CreateInputMethodConfigureView( 599 views::DialogDelegate* LanguageConfigView::CreateInputMethodConfigureView(
599 const std::string& input_method_id) { 600 const std::string& input_method_id) {
600 InputMethodConfigViewMap::const_iterator iter = 601 InputMethodConfigViewMap::const_iterator iter =
(...skipping 20 matching lines...) Expand all
621 622
622 void LanguageConfigView::EnableAllCheckboxes() { 623 void LanguageConfigView::EnableAllCheckboxes() {
623 for (std::set<InputMethodCheckbox*>::iterator checkbox = 624 for (std::set<InputMethodCheckbox*>::iterator checkbox =
624 input_method_checkboxes_.begin(); 625 input_method_checkboxes_.begin();
625 checkbox != input_method_checkboxes_.end(); ++checkbox) { 626 checkbox != input_method_checkboxes_.end(); ++checkbox) {
626 (*checkbox)->SetEnabled(true); 627 (*checkbox)->SetEnabled(true);
627 } 628 }
628 } 629 }
629 630
630 } // namespace chromeos 631 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/options/language_config_util.h ('k') | chrome/browser/chromeos/options/language_hangul_config_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698