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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 UMA_HISTOGRAM_BOOLEAN("Mouse.PrimaryButtonRight.Started", right); | 472 UMA_HISTOGRAM_BOOLEAN("Mouse.PrimaryButtonRight.Started", right); |
473 | 473 |
474 // Save owner preference in local state to use on login screen. | 474 // Save owner preference in local state to use on login screen. |
475 if (chromeos::UserManager::Get()->IsCurrentUserOwner()) { | 475 if (chromeos::UserManager::Get()->IsCurrentUserOwner()) { |
476 PrefService* prefs = g_browser_process->local_state(); | 476 PrefService* prefs = g_browser_process->local_state(); |
477 if (prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight) != right) | 477 if (prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight) != right) |
478 prefs->SetBoolean(prefs::kOwnerPrimaryMouseButtonRight, right); | 478 prefs->SetBoolean(prefs::kOwnerPrimaryMouseButtonRight, right); |
479 } | 479 } |
480 } | 480 } |
481 if (!pref_name || *pref_name == prefs::kDownloadDefaultDirectory) { | 481 if (!pref_name || *pref_name == prefs::kDownloadDefaultDirectory) { |
482 const bool default_download_to_drive = gdata::util::IsUnderDriveMountPoint( | 482 const bool default_download_to_drive = drive::util::IsUnderDriveMountPoint( |
483 download_default_directory_.GetValue()); | 483 download_default_directory_.GetValue()); |
484 if (pref_name) | 484 if (pref_name) |
485 UMA_HISTOGRAM_BOOLEAN( | 485 UMA_HISTOGRAM_BOOLEAN( |
486 "FileBrowser.DownloadDestination.IsGoogleDrive.Changed", | 486 "FileBrowser.DownloadDestination.IsGoogleDrive.Changed", |
487 default_download_to_drive); | 487 default_download_to_drive); |
488 else | 488 else |
489 UMA_HISTOGRAM_BOOLEAN( | 489 UMA_HISTOGRAM_BOOLEAN( |
490 "FileBrowser.DownloadDestination.IsGoogleDrive.Started", | 490 "FileBrowser.DownloadDestination.IsGoogleDrive.Started", |
491 default_download_to_drive); | 491 default_download_to_drive); |
492 } | 492 } |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 | 633 |
634 // Init or update protected content (DRM) support. | 634 // Init or update protected content (DRM) support. |
635 if (!pref_name || *pref_name == prefs::kEnableCrosDRM) { | 635 if (!pref_name || *pref_name == prefs::kEnableCrosDRM) { |
636 system::ToggleDrm(enable_drm_.GetValue()); | 636 system::ToggleDrm(enable_drm_.GetValue()); |
637 } | 637 } |
638 | 638 |
639 // Change the download directory to the default value if a GData directory is | 639 // Change the download directory to the default value if a GData directory is |
640 // selected and GData is disabled. | 640 // selected and GData is disabled. |
641 if (!pref_name || *pref_name == prefs::kDisableGData) { | 641 if (!pref_name || *pref_name == prefs::kDisableGData) { |
642 if (disable_drive_.GetValue()) { | 642 if (disable_drive_.GetValue()) { |
643 if (gdata::util::IsUnderDriveMountPoint( | 643 if (drive::util::IsUnderDriveMountPoint( |
644 download_default_directory_.GetValue())) { | 644 download_default_directory_.GetValue())) { |
645 prefs_->SetFilePath(prefs::kDownloadDefaultDirectory, | 645 prefs_->SetFilePath(prefs::kDownloadDefaultDirectory, |
646 download_util::GetDefaultDownloadDirectory()); | 646 download_util::GetDefaultDownloadDirectory()); |
647 } | 647 } |
648 } | 648 } |
649 } | 649 } |
650 } | 650 } |
651 | 651 |
652 void Preferences::SetLanguageConfigBoolean(const char* section, | 652 void Preferences::SetLanguageConfigBoolean(const char* section, |
653 const char* name, | 653 const char* name, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 | 740 |
741 input_method::AutoRepeatRate rate; | 741 input_method::AutoRepeatRate rate; |
742 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); | 742 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); |
743 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); | 743 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); |
744 DCHECK(rate.initial_delay_in_ms > 0); | 744 DCHECK(rate.initial_delay_in_ms > 0); |
745 DCHECK(rate.repeat_interval_in_ms > 0); | 745 DCHECK(rate.repeat_interval_in_ms > 0); |
746 input_method::XKeyboard::SetAutoRepeatRate(rate); | 746 input_method::XKeyboard::SetAutoRepeatRate(rate); |
747 } | 747 } |
748 | 748 |
749 } // namespace chromeos | 749 } // namespace chromeos |
OLD | NEW |