| 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/system_page_view.h" | 5 #include "chrome/browser/chromeos/options/system_page_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/combobox_model.h" | 10 #include "app/combobox_model.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 return; | 185 return; |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 void DateTimeSection::InitContents(GridLayout* layout) { | 190 void DateTimeSection::InitContents(GridLayout* layout) { |
| 191 timezone_combobox_ = new views::Combobox(&timezone_combobox_model_); | 191 timezone_combobox_ = new views::Combobox(&timezone_combobox_model_); |
| 192 timezone_combobox_->set_listener(this); | 192 timezone_combobox_->set_listener(this); |
| 193 | 193 |
| 194 layout->StartRow(0, double_column_view_set_id()); | 194 layout->StartRow(0, double_column_view_set_id()); |
| 195 layout->AddView(new views::Label( | 195 layout->AddView(new views::Label(UTF16ToWide( |
| 196 l10n_util::GetString(IDS_OPTIONS_SETTINGS_TIMEZONE_DESCRIPTION))); | 196 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_TIMEZONE_DESCRIPTION)))); |
| 197 layout->AddView(timezone_combobox_); | 197 layout->AddView(timezone_combobox_); |
| 198 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 198 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 199 | 199 |
| 200 TimezoneChanged(CrosLibrary::Get()->GetSystemLibrary()->GetTimezone()); | 200 TimezoneChanged(CrosLibrary::Get()->GetSystemLibrary()->GetTimezone()); |
| 201 } | 201 } |
| 202 | 202 |
| 203 //////////////////////////////////////////////////////////////////////////////// | 203 //////////////////////////////////////////////////////////////////////////////// |
| 204 // TouchpadSection | 204 // TouchpadSection |
| 205 | 205 |
| 206 class TouchpadSection : public SettingsPageSection, | 206 class TouchpadSection : public SettingsPageSection, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 if (sender == sensitivity_slider_) { | 258 if (sender == sensitivity_slider_) { |
| 259 double value = sensitivity_slider_->value(); | 259 double value = sensitivity_slider_->value(); |
| 260 UserMetricsRecordAction( | 260 UserMetricsRecordAction( |
| 261 UserMetricsAction("Options_SensitivitySlider_Changed"), | 261 UserMetricsAction("Options_SensitivitySlider_Changed"), |
| 262 profile()->GetPrefs()); | 262 profile()->GetPrefs()); |
| 263 sensitivity_.SetValue(value); | 263 sensitivity_.SetValue(value); |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 | 266 |
| 267 void TouchpadSection::InitContents(GridLayout* layout) { | 267 void TouchpadSection::InitContents(GridLayout* layout) { |
| 268 enable_tap_to_click_checkbox_ = new views::Checkbox(l10n_util::GetString( | 268 enable_tap_to_click_checkbox_ = |
| 269 IDS_OPTIONS_SETTINGS_TAP_TO_CLICK_ENABLED_DESCRIPTION)); | 269 new views::Checkbox(UTF16ToWide(l10n_util::GetStringUTF16( |
| 270 IDS_OPTIONS_SETTINGS_TAP_TO_CLICK_ENABLED_DESCRIPTION))); |
| 270 enable_tap_to_click_checkbox_->set_listener(this); | 271 enable_tap_to_click_checkbox_->set_listener(this); |
| 271 enable_tap_to_click_checkbox_->SetMultiLine(true); | 272 enable_tap_to_click_checkbox_->SetMultiLine(true); |
| 272 // Create sensitivity slider with values between 1 and 5 step 1 | 273 // Create sensitivity slider with values between 1 and 5 step 1 |
| 273 sensitivity_slider_ = new views::Slider(1, 5, 1, | 274 sensitivity_slider_ = new views::Slider(1, 5, 1, |
| 274 static_cast<views::Slider::StyleFlags>( | 275 static_cast<views::Slider::StyleFlags>( |
| 275 views::Slider::STYLE_DRAW_VALUE | | 276 views::Slider::STYLE_DRAW_VALUE | |
| 276 views::Slider::STYLE_UPDATE_ON_RELEASE), | 277 views::Slider::STYLE_UPDATE_ON_RELEASE), |
| 277 this); | 278 this); |
| 278 | 279 |
| 279 layout->StartRow(0, double_column_view_set_id()); | 280 layout->StartRow(0, double_column_view_set_id()); |
| 280 layout->AddView(new views::Label( | 281 layout->AddView(new views::Label(UTF16ToWide(l10n_util::GetStringUTF16( |
| 281 l10n_util::GetString(IDS_OPTIONS_SETTINGS_SENSITIVITY_DESCRIPTION))); | 282 IDS_OPTIONS_SETTINGS_SENSITIVITY_DESCRIPTION)))); |
| 282 layout->AddView(sensitivity_slider_); | 283 layout->AddView(sensitivity_slider_); |
| 283 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 284 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 284 layout->StartRow(0, single_column_view_set_id()); | 285 layout->StartRow(0, single_column_view_set_id()); |
| 285 layout->AddView(enable_tap_to_click_checkbox_); | 286 layout->AddView(enable_tap_to_click_checkbox_); |
| 286 layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); | 287 layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); |
| 287 | 288 |
| 288 // Init member prefs so we can update the controls if prefs change. | 289 // Init member prefs so we can update the controls if prefs change. |
| 289 tap_to_click_enabled_.Init(prefs::kTapToClickEnabled, | 290 tap_to_click_enabled_.Init(prefs::kTapToClickEnabled, |
| 290 profile()->GetPrefs(), this); | 291 profile()->GetPrefs(), this); |
| 291 sensitivity_.Init(prefs::kTouchpadSensitivity, | 292 sensitivity_.Init(prefs::kTouchpadSensitivity, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 prefs::kLanguageXkbRemapControlKeyTo, profile->GetPrefs(), this); | 353 prefs::kLanguageXkbRemapControlKeyTo, profile->GetPrefs(), this); |
| 353 xkb_remap_alt_key_pref_.Init( | 354 xkb_remap_alt_key_pref_.Init( |
| 354 prefs::kLanguageXkbRemapAltKeyTo, profile->GetPrefs(), this); | 355 prefs::kLanguageXkbRemapAltKeyTo, profile->GetPrefs(), this); |
| 355 } | 356 } |
| 356 | 357 |
| 357 void LanguageSection::InitContents(GridLayout* layout) { | 358 void LanguageSection::InitContents(GridLayout* layout) { |
| 358 // Add the customize button and XKB combobox. | 359 // Add the customize button and XKB combobox. |
| 359 layout->StartRow(0, double_column_view_set_id()); | 360 layout->StartRow(0, double_column_view_set_id()); |
| 360 views::NativeButton* customize_languages_button = new views::NativeButton( | 361 views::NativeButton* customize_languages_button = new views::NativeButton( |
| 361 this, | 362 this, |
| 362 l10n_util::GetString(IDS_OPTIONS_SETTINGS_LANGUAGES_CUSTOMIZE)); | 363 UTF16ToWide(l10n_util::GetStringUTF16( |
| 364 IDS_OPTIONS_SETTINGS_LANGUAGES_CUSTOMIZE))); |
| 363 customize_languages_button->set_tag(kCustomizeLanguagesButton); | 365 customize_languages_button->set_tag(kCustomizeLanguagesButton); |
| 364 | 366 |
| 365 xkb_modifier_combobox_ = new views::Combobox(&xkb_modifier_combobox_model_); | 367 xkb_modifier_combobox_ = new views::Combobox(&xkb_modifier_combobox_model_); |
| 366 xkb_modifier_combobox_->set_listener(this); | 368 xkb_modifier_combobox_->set_listener(this); |
| 367 | 369 |
| 368 // Initialize the combobox to what's saved in user preferences. Otherwise, | 370 // Initialize the combobox to what's saved in user preferences. Otherwise, |
| 369 // ItemChanged() will be called with |new_index| == 0. | 371 // ItemChanged() will be called with |new_index| == 0. |
| 370 NotifyPrefChanged(NULL); | 372 NotifyPrefChanged(NULL); |
| 371 | 373 |
| 372 layout->AddView(customize_languages_button, 1, 1, | 374 layout->AddView(customize_languages_button, 1, 1, |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 DISALLOW_COPY_AND_ASSIGN(AccessibilitySection); | 469 DISALLOW_COPY_AND_ASSIGN(AccessibilitySection); |
| 468 }; | 470 }; |
| 469 | 471 |
| 470 AccessibilitySection::AccessibilitySection(Profile* profile) | 472 AccessibilitySection::AccessibilitySection(Profile* profile) |
| 471 : SettingsPageSection(profile, | 473 : SettingsPageSection(profile, |
| 472 IDS_OPTIONS_SETTINGS_SECTION_TITLE_ACCESSIBILITY), | 474 IDS_OPTIONS_SETTINGS_SECTION_TITLE_ACCESSIBILITY), |
| 473 accessibility_checkbox_(NULL) { | 475 accessibility_checkbox_(NULL) { |
| 474 } | 476 } |
| 475 | 477 |
| 476 void AccessibilitySection::InitContents(GridLayout* layout) { | 478 void AccessibilitySection::InitContents(GridLayout* layout) { |
| 477 accessibility_checkbox_ = new views::Checkbox(l10n_util::GetString( | 479 accessibility_checkbox_ = |
| 478 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_DESCRIPTION)); | 480 new views::Checkbox(UTF16ToWide(l10n_util::GetStringUTF16( |
| 481 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_DESCRIPTION))); |
| 479 accessibility_checkbox_->set_listener(this); | 482 accessibility_checkbox_->set_listener(this); |
| 480 accessibility_checkbox_->SetMultiLine(true); | 483 accessibility_checkbox_->SetMultiLine(true); |
| 481 | 484 |
| 482 layout->StartRow(0, double_column_view_set_id()); | 485 layout->StartRow(0, double_column_view_set_id()); |
| 483 layout->AddView(accessibility_checkbox_); | 486 layout->AddView(accessibility_checkbox_); |
| 484 layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); | 487 layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); |
| 485 | 488 |
| 486 // Init member prefs so we can update the controls if prefs change. | 489 // Init member prefs so we can update the controls if prefs change. |
| 487 accessibility_enabled_.Init(prefs::kAccessibilityEnabled, | 490 accessibility_enabled_.Init(prefs::kAccessibilityEnabled, |
| 488 profile()->GetPrefs(), this); | 491 profile()->GetPrefs(), this); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 530 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 528 layout->StartRow(0, single_column_view_set_id); | 531 layout->StartRow(0, single_column_view_set_id); |
| 529 layout->AddView(new LanguageSection(profile())); | 532 layout->AddView(new LanguageSection(profile())); |
| 530 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 533 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 531 layout->StartRow(0, single_column_view_set_id); | 534 layout->StartRow(0, single_column_view_set_id); |
| 532 layout->AddView(new AccessibilitySection(profile())); | 535 layout->AddView(new AccessibilitySection(profile())); |
| 533 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 536 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 534 } | 537 } |
| 535 | 538 |
| 536 } // namespace chromeos | 539 } // namespace chromeos |
| OLD | NEW |