| 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/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 language_prefs::kPreloadEnginesConfigName, | 546 language_prefs::kPreloadEnginesConfigName, |
| 547 preload_engines_.GetValue()); | 547 preload_engines_.GetValue()); |
| 548 } | 548 } |
| 549 | 549 |
| 550 if ((reason == REASON_INITIALIZATION) || | 550 if ((reason == REASON_INITIALIZATION) || |
| 551 (pref_name == prefs::kLanguageEnabledExtensionImes && | 551 (pref_name == prefs::kLanguageEnabledExtensionImes && |
| 552 reason == REASON_PREF_CHANGED)) { | 552 reason == REASON_PREF_CHANGED)) { |
| 553 std::string value(enabled_extension_imes_.GetValue()); | 553 std::string value(enabled_extension_imes_.GetValue()); |
| 554 | 554 |
| 555 std::vector<std::string> split_values; | 555 std::vector<std::string> split_values; |
| 556 if (!value.empty()) | 556 if (!value.empty()) { |
| 557 base::SplitString(value, ',', &split_values); | 557 split_values = base::SplitString(value, ",", base::TRIM_WHITESPACE, |
| 558 | 558 base::SPLIT_WANT_ALL); |
| 559 } |
| 559 ime_state_->SetEnabledExtensionImes(&split_values); | 560 ime_state_->SetEnabledExtensionImes(&split_values); |
| 560 } | 561 } |
| 561 | 562 |
| 562 if (user_is_active) { | 563 if (user_is_active) { |
| 563 system::InputDeviceSettings::Get()->UpdateTouchpadSettings( | 564 system::InputDeviceSettings::Get()->UpdateTouchpadSettings( |
| 564 touchpad_settings); | 565 touchpad_settings); |
| 565 system::InputDeviceSettings::Get()->UpdateMouseSettings(mouse_settings); | 566 system::InputDeviceSettings::Get()->UpdateMouseSettings(mouse_settings); |
| 566 } | 567 } |
| 567 | 568 |
| 568 if (user_is_primary_ && (reason != REASON_PREF_CHANGED || | 569 if (user_is_primary_ && (reason != REASON_PREF_CHANGED || |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); | 616 UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); |
| 616 } | 617 } |
| 617 } | 618 } |
| 618 | 619 |
| 619 void Preferences::SetLanguageConfigStringListAsCSV(const char* section, | 620 void Preferences::SetLanguageConfigStringListAsCSV(const char* section, |
| 620 const char* name, | 621 const char* name, |
| 621 const std::string& value) { | 622 const std::string& value) { |
| 622 VLOG(1) << "Setting " << name << " to '" << value << "'"; | 623 VLOG(1) << "Setting " << name << " to '" << value << "'"; |
| 623 | 624 |
| 624 std::vector<std::string> split_values; | 625 std::vector<std::string> split_values; |
| 625 if (!value.empty()) | 626 if (!value.empty()) { |
| 626 base::SplitString(value, ',', &split_values); | 627 split_values = base::SplitString(value, ",", base::TRIM_WHITESPACE, |
| 628 base::SPLIT_WANT_ALL); |
| 629 } |
| 627 | 630 |
| 628 // Transfers the xkb id to extension-xkb id. | 631 // Transfers the xkb id to extension-xkb id. |
| 629 if (input_method_manager_->MigrateInputMethods(&split_values)) | 632 if (input_method_manager_->MigrateInputMethods(&split_values)) |
| 630 preload_engines_.SetValue(base::JoinString(split_values, ",")); | 633 preload_engines_.SetValue(base::JoinString(split_values, ",")); |
| 631 | 634 |
| 632 if (section == std::string(language_prefs::kGeneralSectionName) && | 635 if (section == std::string(language_prefs::kGeneralSectionName) && |
| 633 name == std::string(language_prefs::kPreloadEnginesConfigName)) { | 636 name == std::string(language_prefs::kPreloadEnginesConfigName)) { |
| 634 ime_state_->ReplaceEnabledInputMethods(split_values); | 637 ime_state_->ReplaceEnabledInputMethods(split_values); |
| 635 return; | 638 return; |
| 636 } | 639 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 touch_hud_projection_enabled_.SetValue(enabled); | 685 touch_hud_projection_enabled_.SetValue(enabled); |
| 683 } | 686 } |
| 684 | 687 |
| 685 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { | 688 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { |
| 686 if (active_user != user_) | 689 if (active_user != user_) |
| 687 return; | 690 return; |
| 688 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 691 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
| 689 } | 692 } |
| 690 | 693 |
| 691 } // namespace chromeos | 694 } // namespace chromeos |
| OLD | NEW |