| 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 "base/chromeos/chromeos_version.h" | 7 #include "base/chromeos/chromeos_version.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 UMA_HISTOGRAM_BOOLEAN("Mouse.PrimaryButtonRight.Started", right); | 463 UMA_HISTOGRAM_BOOLEAN("Mouse.PrimaryButtonRight.Started", right); |
| 464 | 464 |
| 465 // Save owner preference in local state to use on login screen. | 465 // Save owner preference in local state to use on login screen. |
| 466 if (chromeos::UserManager::Get()->IsCurrentUserOwner()) { | 466 if (chromeos::UserManager::Get()->IsCurrentUserOwner()) { |
| 467 PrefService* prefs = g_browser_process->local_state(); | 467 PrefService* prefs = g_browser_process->local_state(); |
| 468 if (prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight) != right) | 468 if (prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight) != right) |
| 469 prefs->SetBoolean(prefs::kOwnerPrimaryMouseButtonRight, right); | 469 prefs->SetBoolean(prefs::kOwnerPrimaryMouseButtonRight, right); |
| 470 } | 470 } |
| 471 } | 471 } |
| 472 if (!pref_name || *pref_name == prefs::kDownloadDefaultDirectory) { | 472 if (!pref_name || *pref_name == prefs::kDownloadDefaultDirectory) { |
| 473 const bool default_download_to_drive = gdata::util::IsUnderDriveMountPoint( | 473 const bool default_download_to_drive = drive::util::IsUnderDriveMountPoint( |
| 474 download_default_directory_.GetValue()); | 474 download_default_directory_.GetValue()); |
| 475 if (pref_name) | 475 if (pref_name) |
| 476 UMA_HISTOGRAM_BOOLEAN( | 476 UMA_HISTOGRAM_BOOLEAN( |
| 477 "FileBrowser.DownloadDestination.IsGoogleDrive.Changed", | 477 "FileBrowser.DownloadDestination.IsGoogleDrive.Changed", |
| 478 default_download_to_drive); | 478 default_download_to_drive); |
| 479 else | 479 else |
| 480 UMA_HISTOGRAM_BOOLEAN( | 480 UMA_HISTOGRAM_BOOLEAN( |
| 481 "FileBrowser.DownloadDestination.IsGoogleDrive.Started", | 481 "FileBrowser.DownloadDestination.IsGoogleDrive.Started", |
| 482 default_download_to_drive); | 482 default_download_to_drive); |
| 483 } | 483 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 | 624 |
| 625 // Init or update protected content (DRM) support. | 625 // Init or update protected content (DRM) support. |
| 626 if (!pref_name || *pref_name == prefs::kEnableCrosDRM) { | 626 if (!pref_name || *pref_name == prefs::kEnableCrosDRM) { |
| 627 system::ToggleDrm(enable_drm_.GetValue()); | 627 system::ToggleDrm(enable_drm_.GetValue()); |
| 628 } | 628 } |
| 629 | 629 |
| 630 // Change the download directory to the default value if a GData directory is | 630 // Change the download directory to the default value if a GData directory is |
| 631 // selected and GData is disabled. | 631 // selected and GData is disabled. |
| 632 if (!pref_name || *pref_name == prefs::kDisableGData) { | 632 if (!pref_name || *pref_name == prefs::kDisableGData) { |
| 633 if (disable_drive_.GetValue()) { | 633 if (disable_drive_.GetValue()) { |
| 634 if (gdata::util::IsUnderDriveMountPoint( | 634 if (drive::util::IsUnderDriveMountPoint( |
| 635 download_default_directory_.GetValue())) { | 635 download_default_directory_.GetValue())) { |
| 636 prefs_->SetFilePath(prefs::kDownloadDefaultDirectory, | 636 prefs_->SetFilePath(prefs::kDownloadDefaultDirectory, |
| 637 download_util::GetDefaultDownloadDirectory()); | 637 download_util::GetDefaultDownloadDirectory()); |
| 638 } | 638 } |
| 639 } | 639 } |
| 640 } | 640 } |
| 641 } | 641 } |
| 642 | 642 |
| 643 void Preferences::SetLanguageConfigBoolean(const char* section, | 643 void Preferences::SetLanguageConfigBoolean(const char* section, |
| 644 const char* name, | 644 const char* name, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 | 731 |
| 732 input_method::AutoRepeatRate rate; | 732 input_method::AutoRepeatRate rate; |
| 733 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); | 733 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); |
| 734 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); | 734 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); |
| 735 DCHECK(rate.initial_delay_in_ms > 0); | 735 DCHECK(rate.initial_delay_in_ms > 0); |
| 736 DCHECK(rate.repeat_interval_in_ms > 0); | 736 DCHECK(rate.repeat_interval_in_ms > 0); |
| 737 input_method::XKeyboard::SetAutoRepeatRate(rate); | 737 input_method::XKeyboard::SetAutoRepeatRate(rate); |
| 738 } | 738 } |
| 739 | 739 |
| 740 } // namespace chromeos | 740 } // namespace chromeos |
| OLD | NEW |