| 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 "ash/magnifier/magnifier_constants.h" | 7 #include "ash/magnifier/magnifier_constants.h" |
| 8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 use_24hour_clock_.Init(prefs::kUse24HourClock, prefs, callback); | 363 use_24hour_clock_.Init(prefs::kUse24HourClock, prefs, callback); |
| 364 disable_drive_.Init(prefs::kDisableDrive, prefs, callback); | 364 disable_drive_.Init(prefs::kDisableDrive, prefs, callback); |
| 365 disable_drive_over_cellular_.Init(prefs::kDisableDriveOverCellular, | 365 disable_drive_over_cellular_.Init(prefs::kDisableDriveOverCellular, |
| 366 prefs, callback); | 366 prefs, callback); |
| 367 disable_drive_hosted_files_.Init(prefs::kDisableDriveHostedFiles, | 367 disable_drive_hosted_files_.Init(prefs::kDisableDriveHostedFiles, |
| 368 prefs, callback); | 368 prefs, callback); |
| 369 download_default_directory_.Init(prefs::kDownloadDefaultDirectory, | 369 download_default_directory_.Init(prefs::kDownloadDefaultDirectory, |
| 370 prefs, callback); | 370 prefs, callback); |
| 371 select_file_last_directory_.Init(prefs::kSelectFileLastDirectory, | 371 select_file_last_directory_.Init(prefs::kSelectFileLastDirectory, |
| 372 prefs, callback); | 372 prefs, callback); |
| 373 save_file_default_directory_.Init(prefs::kSaveFileDefaultDirectory, |
| 374 prefs, callback); |
| 373 primary_mouse_button_right_.Init(prefs::kPrimaryMouseButtonRight, | 375 primary_mouse_button_right_.Init(prefs::kPrimaryMouseButtonRight, |
| 374 prefs, callback); | 376 prefs, callback); |
| 375 preferred_languages_.Init(prefs::kLanguagePreferredLanguages, | 377 preferred_languages_.Init(prefs::kLanguagePreferredLanguages, |
| 376 prefs, callback); | 378 prefs, callback); |
| 377 preload_engines_.Init(prefs::kLanguagePreloadEngines, prefs, callback); | 379 preload_engines_.Init(prefs::kLanguagePreloadEngines, prefs, callback); |
| 378 filtered_extension_imes_.Init(prefs::kLanguageFilteredExtensionImes, | 380 filtered_extension_imes_.Init(prefs::kLanguageFilteredExtensionImes, |
| 379 prefs, callback); | 381 prefs, callback); |
| 380 current_input_method_.Init(prefs::kLanguageCurrentInputMethod, | 382 current_input_method_.Init(prefs::kLanguageCurrentInputMethod, |
| 381 prefs, callback); | 383 prefs, callback); |
| 382 previous_input_method_.Init(prefs::kLanguagePreviousInputMethod, | 384 previous_input_method_.Init(prefs::kLanguagePreviousInputMethod, |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 if (!pref_name || *pref_name == prefs::kSelectFileLastDirectory) { | 605 if (!pref_name || *pref_name == prefs::kSelectFileLastDirectory) { |
| 604 const base::FilePath pref_path = select_file_last_directory_.GetValue(); | 606 const base::FilePath pref_path = select_file_last_directory_.GetValue(); |
| 605 // This pref can contain a Drive path, which needs to be updated due to | 607 // This pref can contain a Drive path, which needs to be updated due to |
| 606 // namespaces introduced by crbug.com/174233. | 608 // namespaces introduced by crbug.com/174233. |
| 607 // TODO(haruki): Remove this when migration completes. crbug.com/229304. | 609 // TODO(haruki): Remove this when migration completes. crbug.com/229304. |
| 608 if (drive::util::NeedsNamespaceMigration(pref_path)) { | 610 if (drive::util::NeedsNamespaceMigration(pref_path)) { |
| 609 prefs_->SetFilePath(prefs::kSelectFileLastDirectory, | 611 prefs_->SetFilePath(prefs::kSelectFileLastDirectory, |
| 610 drive::util::ConvertToMyDriveNamespace(pref_path)); | 612 drive::util::ConvertToMyDriveNamespace(pref_path)); |
| 611 } | 613 } |
| 612 } | 614 } |
| 615 if (!pref_name || *pref_name == prefs::kSaveFileDefaultDirectory) { |
| 616 const base::FilePath pref_path = save_file_default_directory_.GetValue(); |
| 617 // This pref can contain a Drive path, which needs to be updated due to |
| 618 // namespaces introduced by crbug.com/174233. |
| 619 // TODO(haruki): Remove this when migration completes. crbug.com/229304. |
| 620 if (drive::util::NeedsNamespaceMigration(pref_path)) { |
| 621 prefs_->SetFilePath(prefs::kSaveFileDefaultDirectory, |
| 622 drive::util::ConvertToMyDriveNamespace(pref_path)); |
| 623 } |
| 624 } |
| 613 | 625 |
| 614 if (!pref_name || *pref_name == prefs::kLanguagePreferredLanguages) { | 626 if (!pref_name || *pref_name == prefs::kLanguagePreferredLanguages) { |
| 615 // Unlike kLanguagePreloadEngines and some other input method | 627 // Unlike kLanguagePreloadEngines and some other input method |
| 616 // preferencs, we don't need to send this to ibus-daemon. | 628 // preferencs, we don't need to send this to ibus-daemon. |
| 617 } | 629 } |
| 618 | 630 |
| 619 if (!pref_name || *pref_name == prefs::kLanguageXkbAutoRepeatEnabled) { | 631 if (!pref_name || *pref_name == prefs::kLanguageXkbAutoRepeatEnabled) { |
| 620 const bool enabled = xkb_auto_repeat_enabled_.GetValue(); | 632 const bool enabled = xkb_auto_repeat_enabled_.GetValue(); |
| 621 input_method::XKeyboard::SetAutoRepeatEnabled(enabled); | 633 input_method::XKeyboard::SetAutoRepeatEnabled(enabled); |
| 622 } | 634 } |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 | 917 |
| 906 input_method::AutoRepeatRate rate; | 918 input_method::AutoRepeatRate rate; |
| 907 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); | 919 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); |
| 908 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); | 920 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); |
| 909 DCHECK(rate.initial_delay_in_ms > 0); | 921 DCHECK(rate.initial_delay_in_ms > 0); |
| 910 DCHECK(rate.repeat_interval_in_ms > 0); | 922 DCHECK(rate.repeat_interval_in_ms > 0); |
| 911 input_method::XKeyboard::SetAutoRepeatRate(rate); | 923 input_method::XKeyboard::SetAutoRepeatRate(rate); |
| 912 } | 924 } |
| 913 | 925 |
| 914 } // namespace chromeos | 926 } // namespace chromeos |
| OLD | NEW |