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 15 matching lines...) Expand all Loading... |
26 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 26 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
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/input_method_manager.h" | 37 #include "chromeos/ime/input_method_manager.h" |
37 #include "chromeos/ime/xkeyboard.h" | 38 #include "chromeos/ime/xkeyboard.h" |
38 #include "chromeos/system/statistics_provider.h" | 39 #include "chromeos/system/statistics_provider.h" |
39 #include "components/user_prefs/pref_registry_syncable.h" | 40 #include "components/user_prefs/pref_registry_syncable.h" |
40 #include "third_party/icu/source/i18n/unicode/timezone.h" | 41 #include "third_party/icu/source/i18n/unicode/timezone.h" |
41 #include "ui/events/event_constants.h" | 42 #include "ui/events/event_constants.h" |
42 #include "ui/events/event_utils.h" | 43 #include "ui/events/event_utils.h" |
43 #include "url/gurl.h" | 44 #include "url/gurl.h" |
44 | 45 |
45 namespace chromeos { | 46 namespace chromeos { |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 | 576 |
576 void Preferences::SetLanguageConfigStringListAsCSV(const char* section, | 577 void Preferences::SetLanguageConfigStringListAsCSV(const char* section, |
577 const char* name, | 578 const char* name, |
578 const std::string& value) { | 579 const std::string& value) { |
579 VLOG(1) << "Setting " << name << " to '" << value << "'"; | 580 VLOG(1) << "Setting " << name << " to '" << value << "'"; |
580 | 581 |
581 std::vector<std::string> split_values; | 582 std::vector<std::string> split_values; |
582 if (!value.empty()) | 583 if (!value.empty()) |
583 base::SplitString(value, ',', &split_values); | 584 base::SplitString(value, ',', &split_values); |
584 | 585 |
| 586 // TODO(shuchen): migration of the xkb id to extension-xkb id. |
| 587 // Remove this function after few milestones are passed. |
| 588 // See: http://crbug.com/345604 |
| 589 if (input_method_manager_->MigrateXkbInputMethods(&split_values)) |
| 590 preload_engines_.SetValue(JoinString(split_values, ',')); |
| 591 |
585 if (section == std::string(language_prefs::kGeneralSectionName) && | 592 if (section == std::string(language_prefs::kGeneralSectionName) && |
586 name == std::string(language_prefs::kPreloadEnginesConfigName)) { | 593 name == std::string(language_prefs::kPreloadEnginesConfigName)) { |
587 input_method_manager_->ReplaceEnabledInputMethods(split_values); | 594 input_method_manager_->ReplaceEnabledInputMethods(split_values); |
588 return; | 595 return; |
589 } | 596 } |
590 } | 597 } |
591 | 598 |
592 void Preferences::SetInputMethodList() { | 599 void Preferences::SetInputMethodList() { |
593 // When |preload_engines_| are set, InputMethodManager::ChangeInputMethod() | 600 // When |preload_engines_| are set, InputMethodManager::ChangeInputMethod() |
594 // might be called to change the current input method to the first one in the | 601 // might be called to change the current input method to the first one in the |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 touch_hud_projection_enabled_.SetValue(enabled); | 639 touch_hud_projection_enabled_.SetValue(enabled); |
633 } | 640 } |
634 | 641 |
635 void Preferences::ActiveUserChanged(const User* active_user) { | 642 void Preferences::ActiveUserChanged(const User* active_user) { |
636 if (active_user != user_) | 643 if (active_user != user_) |
637 return; | 644 return; |
638 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 645 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
639 } | 646 } |
640 | 647 |
641 } // namespace chromeos | 648 } // namespace chromeos |
OLD | NEW |