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/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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 if (preferred_language_table_->GetRowCount() > 1 && | 223 if (preferred_language_table_->GetRowCount() > 1 && |
224 language_code != g_browser_process->GetApplicationLocale() && | 224 language_code != g_browser_process->GetApplicationLocale() && |
225 num_all_active_input_methods > num_selected_active_input_methods) { | 225 num_all_active_input_methods > num_selected_active_input_methods) { |
226 remove_button_enabled = true; | 226 remove_button_enabled = true; |
227 } | 227 } |
228 remove_language_button_->SetEnabled(remove_button_enabled); | 228 remove_language_button_->SetEnabled(remove_button_enabled); |
229 | 229 |
230 // Add the per language config view to the right area. | 230 // Add the per language config view to the right area. |
231 right_container_->AddChildView(CreatePerLanguageConfigView(language_code)); | 231 right_container_->AddChildView(CreatePerLanguageConfigView(language_code)); |
232 MaybeDisableLastCheckbox(); | 232 MaybeDisableLastCheckbox(); |
233 // Let the parent container layout again. This is needed to the the | 233 // Layout the right container. This is needed for the contents on the |
234 // contents on the right to display. | 234 // right to be displayed properly. |
235 root_container_->Layout(); | 235 right_container_->Layout(); |
236 } | 236 } |
237 | 237 |
238 std::wstring LanguageConfigView::GetText(int row, int column_id) { | 238 std::wstring LanguageConfigView::GetText(int row, int column_id) { |
239 if (row >= 0 && row < static_cast<int>( | 239 if (row >= 0 && row < static_cast<int>( |
240 model.num_preferred_language_codes())) { | 240 model.num_preferred_language_codes())) { |
241 return input_method::GetLanguageDisplayNameFromCode( | 241 return input_method::GetLanguageDisplayNameFromCode( |
242 model.preferred_language_code_at(row)); | 242 model.preferred_language_code_at(row)); |
243 } | 243 } |
244 NOTREACHED(); | 244 NOTREACHED(); |
245 return L""; | 245 return L""; |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 | 628 |
629 void LanguageConfigView::EnableAllCheckboxes() { | 629 void LanguageConfigView::EnableAllCheckboxes() { |
630 for (std::set<InputMethodCheckbox*>::iterator checkbox = | 630 for (std::set<InputMethodCheckbox*>::iterator checkbox = |
631 input_method_checkboxes_.begin(); | 631 input_method_checkboxes_.begin(); |
632 checkbox != input_method_checkboxes_.end(); ++checkbox) { | 632 checkbox != input_method_checkboxes_.end(); ++checkbox) { |
633 (*checkbox)->SetEnabled(true); | 633 (*checkbox)->SetEnabled(true); |
634 } | 634 } |
635 } | 635 } |
636 | 636 |
637 } // namespace chromeos | 637 } // namespace chromeos |
OLD | NEW |