OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include <windows.h> | 4 #include <windows.h> |
5 #include <shlobj.h> | 5 #include <shlobj.h> |
6 #include <vsstyle.h> | 6 #include <vsstyle.h> |
7 #include <vssym32.h> | 7 #include <vssym32.h> |
8 | 8 |
9 #include "chrome/browser/views/options/languages_page_view.h" | 9 #include "chrome/browser/views/options/languages_page_view.h" |
10 | 10 |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 change_ui_language_combobox_ = | 333 change_ui_language_combobox_ = |
334 new views::Combobox(ui_language_model_.get()); | 334 new views::Combobox(ui_language_model_.get()); |
335 change_ui_language_combobox_->set_listener(this); | 335 change_ui_language_combobox_->set_listener(this); |
336 dictionary_language_label_ = new views::Label( | 336 dictionary_language_label_ = new views::Label( |
337 l10n_util::GetString(IDS_OPTIONS_CHROME_DICTIONARY_LANGUAGE)); | 337 l10n_util::GetString(IDS_OPTIONS_CHROME_DICTIONARY_LANGUAGE)); |
338 dictionary_language_label_->SetHorizontalAlignment( | 338 dictionary_language_label_->SetHorizontalAlignment( |
339 views::Label::ALIGN_LEFT); | 339 views::Label::ALIGN_LEFT); |
340 enable_spellchecking_checkbox_ = new views::Checkbox( | 340 enable_spellchecking_checkbox_ = new views::Checkbox( |
341 l10n_util::GetString(IDS_OPTIONS_ENABLE_SPELLCHECK)); | 341 l10n_util::GetString(IDS_OPTIONS_ENABLE_SPELLCHECK)); |
342 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 342 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
343 if (command_line.HasSwitch(switches::kAutoSpellCorrect)) { | 343 if (command_line.HasSwitch(switches::kExperimentalSpellcheckerFeatures)) { |
344 enable_autospellcorrect_checkbox_ = new views::Checkbox( | 344 enable_autospellcorrect_checkbox_ = new views::Checkbox( |
345 l10n_util::GetString(IDS_OPTIONS_ENABLE_AUTO_SPELL_CORRECTION)); | 345 l10n_util::GetString(IDS_OPTIONS_ENABLE_AUTO_SPELL_CORRECTION)); |
346 enable_autospellcorrect_checkbox_->set_listener(this); | 346 enable_autospellcorrect_checkbox_->set_listener(this); |
347 } | 347 } |
348 enable_spellchecking_checkbox_->set_listener(this); | 348 enable_spellchecking_checkbox_->set_listener(this); |
349 enable_spellchecking_checkbox_->SetMultiLine(true); | 349 enable_spellchecking_checkbox_->SetMultiLine(true); |
350 | 350 |
351 // Determine Locale Codes. | 351 // Determine Locale Codes. |
352 std::vector<std::string> spell_check_languages; | 352 std::vector<std::string> spell_check_languages; |
353 SpellChecker::SpellCheckLanguages(&spell_check_languages); | 353 SpellChecker::SpellCheckLanguages(&spell_check_languages); |
354 dictionary_language_model_.reset(new LanguageComboboxModel(profile(), | 354 dictionary_language_model_.reset(new LanguageComboboxModel(profile(), |
355 spell_check_languages)); | 355 spell_check_languages)); |
356 change_dictionary_language_combobox_ = | 356 change_dictionary_language_combobox_ = |
357 new views::Combobox(dictionary_language_model_.get()); | 357 new views::Combobox(dictionary_language_model_.get()); |
358 change_dictionary_language_combobox_->set_listener(this); | 358 change_dictionary_language_combobox_->set_listener(this); |
359 | 359 |
360 // SpellCheck language settings. | 360 // SpellCheck language settings. |
361 layout->StartRow(0, single_column_view_set_id); | 361 layout->StartRow(0, single_column_view_set_id); |
362 layout->AddView(enable_spellchecking_checkbox_); | 362 layout->AddView(enable_spellchecking_checkbox_); |
363 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 363 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
364 if (command_line.HasSwitch(switches::kAutoSpellCorrect)) { | 364 if (command_line.HasSwitch(switches::kExperimentalSpellcheckerFeatures)) { |
365 layout->StartRow(0, single_column_view_set_id); | 365 layout->StartRow(0, single_column_view_set_id); |
366 layout->AddView(enable_autospellcorrect_checkbox_); | 366 layout->AddView(enable_autospellcorrect_checkbox_); |
367 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 367 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
368 } | 368 } |
369 const int double_column_view_set_2_id = 2; | 369 const int double_column_view_set_2_id = 2; |
370 column_set = layout->AddColumnSet(double_column_view_set_2_id); | 370 column_set = layout->AddColumnSet(double_column_view_set_2_id); |
371 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 0, | 371 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 0, |
372 GridLayout::USE_PREF, 0, 0); | 372 GridLayout::USE_PREF, 0, 0); |
373 column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); | 373 column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); |
374 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, | 374 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 | 439 |
440 change_dictionary_language_combobox_->SetSelectedItem(index); | 440 change_dictionary_language_combobox_->SetSelectedItem(index); |
441 spellcheck_language_index_selected_ = -1; | 441 spellcheck_language_index_selected_ = -1; |
442 } | 442 } |
443 if (!pref_name || *pref_name == prefs::kEnableSpellCheck) { | 443 if (!pref_name || *pref_name == prefs::kEnableSpellCheck) { |
444 enable_spellchecking_checkbox_->SetChecked( | 444 enable_spellchecking_checkbox_->SetChecked( |
445 enable_spellcheck_.GetValue()); | 445 enable_spellcheck_.GetValue()); |
446 } | 446 } |
447 if (!pref_name || *pref_name == prefs::kEnableAutoSpellCorrect) { | 447 if (!pref_name || *pref_name == prefs::kEnableAutoSpellCorrect) { |
448 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 448 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
449 if (command_line.HasSwitch(switches::kAutoSpellCorrect)) { | 449 if (command_line.HasSwitch(switches::kExperimentalSpellcheckerFeatures)) { |
450 enable_autospellcorrect_checkbox_->SetChecked( | 450 enable_autospellcorrect_checkbox_->SetChecked( |
451 enable_autospellcorrect_.GetValue()); | 451 enable_autospellcorrect_.GetValue()); |
452 } | 452 } |
453 } | 453 } |
454 } | 454 } |
455 | 455 |
456 void LanguagesPageView::ItemChanged(views::Combobox* sender, | 456 void LanguagesPageView::ItemChanged(views::Combobox* sender, |
457 int prev_index, | 457 int prev_index, |
458 int new_index) { | 458 int new_index) { |
459 if (prev_index == new_index) | 459 if (prev_index == new_index) |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 } | 569 } |
570 | 570 |
571 if (enable_spellcheck_checkbox_clicked_) | 571 if (enable_spellcheck_checkbox_clicked_) |
572 enable_spellcheck_.SetValue(enable_spellchecking_checkbox_->checked()); | 572 enable_spellcheck_.SetValue(enable_spellchecking_checkbox_->checked()); |
573 | 573 |
574 if (enable_autospellcorrect_checkbox_clicked_) { | 574 if (enable_autospellcorrect_checkbox_clicked_) { |
575 enable_autospellcorrect_.SetValue( | 575 enable_autospellcorrect_.SetValue( |
576 enable_autospellcorrect_checkbox_->checked()); | 576 enable_autospellcorrect_checkbox_->checked()); |
577 } | 577 } |
578 } | 578 } |
OLD | NEW |