| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/preferences.h" | 5 #include "chrome/browser/chromeos/preferences.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/autoclick/autoclick_controller.h" | 9 #include "ash/autoclick/autoclick_controller.h" |
| 10 #include "ash/magnifier/magnifier_constants.h" | 10 #include "ash/magnifier/magnifier_constants.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/chromeos/login/login_utils.h" | 27 #include "chrome/browser/chromeos/login/login_utils.h" |
| 28 #include "chrome/browser/chromeos/login/user.h" | 28 #include "chrome/browser/chromeos/login/user.h" |
| 29 #include "chrome/browser/chromeos/system/input_device_settings.h" | 29 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 30 #include "chrome/browser/download/download_prefs.h" | 30 #include "chrome/browser/download/download_prefs.h" |
| 31 #include "chrome/browser/feedback/tracing_manager.h" | 31 #include "chrome/browser/feedback/tracing_manager.h" |
| 32 #include "chrome/browser/prefs/pref_service_syncable.h" | 32 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 33 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
| 34 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
| 35 #include "chromeos/chromeos_switches.h" | 35 #include "chromeos/chromeos_switches.h" |
| 36 #include "chromeos/ime/extension_ime_util.h" | 36 #include "chromeos/ime/extension_ime_util.h" |
| 37 #include "chromeos/ime/ime_keyboard.h" |
| 37 #include "chromeos/ime/input_method_manager.h" | 38 #include "chromeos/ime/input_method_manager.h" |
| 38 #include "chromeos/ime/xkeyboard.h" | |
| 39 #include "chromeos/system/statistics_provider.h" | 39 #include "chromeos/system/statistics_provider.h" |
| 40 #include "components/user_prefs/pref_registry_syncable.h" | 40 #include "components/user_prefs/pref_registry_syncable.h" |
| 41 #include "third_party/icu/source/i18n/unicode/timezone.h" | 41 #include "third_party/icu/source/i18n/unicode/timezone.h" |
| 42 #include "ui/events/event_constants.h" | 42 #include "ui/events/event_constants.h" |
| 43 #include "ui/events/event_utils.h" | 43 #include "ui/events/event_utils.h" |
| 44 #include "url/gurl.h" | 44 #include "url/gurl.h" |
| 45 | 45 |
| 46 namespace chromeos { | 46 namespace chromeos { |
| 47 | 47 |
| 48 static const char kFallbackInputMethodLocale[] = "en-US"; | 48 static const char kFallbackInputMethodLocale[] = "en-US"; |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 if (user_is_active) { | 511 if (user_is_active) { |
| 512 const bool enabled = touch_hud_projection_enabled_.GetValue(); | 512 const bool enabled = touch_hud_projection_enabled_.GetValue(); |
| 513 ash::Shell::GetInstance()->SetTouchHudProjectionEnabled(enabled); | 513 ash::Shell::GetInstance()->SetTouchHudProjectionEnabled(enabled); |
| 514 } | 514 } |
| 515 } | 515 } |
| 516 | 516 |
| 517 if (reason != REASON_PREF_CHANGED || | 517 if (reason != REASON_PREF_CHANGED || |
| 518 pref_name == prefs::kLanguageXkbAutoRepeatEnabled) { | 518 pref_name == prefs::kLanguageXkbAutoRepeatEnabled) { |
| 519 if (user_is_active) { | 519 if (user_is_active) { |
| 520 const bool enabled = xkb_auto_repeat_enabled_.GetValue(); | 520 const bool enabled = xkb_auto_repeat_enabled_.GetValue(); |
| 521 input_method::InputMethodManager::Get()->GetXKeyboard() | 521 input_method::InputMethodManager::Get() |
| 522 ->GetImeKeyboard() |
| 522 ->SetAutoRepeatEnabled(enabled); | 523 ->SetAutoRepeatEnabled(enabled); |
| 523 } | 524 } |
| 524 } | 525 } |
| 525 if (reason != REASON_PREF_CHANGED || | 526 if (reason != REASON_PREF_CHANGED || |
| 526 pref_name == prefs::kLanguageXkbAutoRepeatDelay || | 527 pref_name == prefs::kLanguageXkbAutoRepeatDelay || |
| 527 pref_name == prefs::kLanguageXkbAutoRepeatInterval) { | 528 pref_name == prefs::kLanguageXkbAutoRepeatInterval) { |
| 528 if (user_is_active) | 529 if (user_is_active) |
| 529 UpdateAutoRepeatRate(); | 530 UpdateAutoRepeatRate(); |
| 530 } | 531 } |
| 531 | 532 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 if (!current_input_method_id.empty()) | 621 if (!current_input_method_id.empty()) |
| 621 input_method_manager_->ChangeInputMethod(current_input_method_id); | 622 input_method_manager_->ChangeInputMethod(current_input_method_id); |
| 622 } | 623 } |
| 623 | 624 |
| 624 void Preferences::UpdateAutoRepeatRate() { | 625 void Preferences::UpdateAutoRepeatRate() { |
| 625 input_method::AutoRepeatRate rate; | 626 input_method::AutoRepeatRate rate; |
| 626 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); | 627 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); |
| 627 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); | 628 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); |
| 628 DCHECK(rate.initial_delay_in_ms > 0); | 629 DCHECK(rate.initial_delay_in_ms > 0); |
| 629 DCHECK(rate.repeat_interval_in_ms > 0); | 630 DCHECK(rate.repeat_interval_in_ms > 0); |
| 630 input_method::InputMethodManager::Get()->GetXKeyboard() | 631 input_method::InputMethodManager::Get() |
| 632 ->GetImeKeyboard() |
| 631 ->SetAutoRepeatRate(rate); | 633 ->SetAutoRepeatRate(rate); |
| 632 } | 634 } |
| 633 | 635 |
| 634 void Preferences::OnTouchHudProjectionToggled(bool enabled) { | 636 void Preferences::OnTouchHudProjectionToggled(bool enabled) { |
| 635 if (touch_hud_projection_enabled_.GetValue() == enabled) | 637 if (touch_hud_projection_enabled_.GetValue() == enabled) |
| 636 return; | 638 return; |
| 637 if (!user_->is_active()) | 639 if (!user_->is_active()) |
| 638 return; | 640 return; |
| 639 touch_hud_projection_enabled_.SetValue(enabled); | 641 touch_hud_projection_enabled_.SetValue(enabled); |
| 640 } | 642 } |
| 641 | 643 |
| 642 void Preferences::ActiveUserChanged(const User* active_user) { | 644 void Preferences::ActiveUserChanged(const User* active_user) { |
| 643 if (active_user != user_) | 645 if (active_user != user_) |
| 644 return; | 646 return; |
| 645 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 647 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
| 646 } | 648 } |
| 647 | 649 |
| 648 } // namespace chromeos | 650 } // namespace chromeos |
| OLD | NEW |