| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/display/quirks_manager_delegate_impl.h" | 5 #include "chrome/browser/chromeos/display/quirks_manager_delegate_impl.h" |
| 6 | 6 |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
| 9 #include "chrome/browser/chromeos/settings/cros_settings.h" | 9 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| 11 #include "chromeos/chromeos_paths.h" | 11 #include "chromeos/chromeos_paths.h" |
| 12 #include "google_apis/google_api_keys.h" | 12 #include "google_apis/google_api_keys.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 const char kUserDataDisplayProfilesDirectory[] = "display_profiles"; | 16 const char kUserDataDisplayProfilesDirectory[] = "display_profiles"; |
| 17 | 17 |
| 18 } // namespace | 18 } // namespace |
| 19 | 19 |
| 20 namespace quirks { | 20 namespace quirks { |
| 21 | 21 |
| 22 std::string QuirksManagerDelegateImpl::GetApiKey() const { | 22 std::string QuirksManagerDelegateImpl::GetApiKey() const { |
| 23 return google_apis::GetAPIKey(); | 23 return google_apis::GetAPIKey(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 base::FilePath QuirksManagerDelegateImpl::GetBuiltInDisplayProfileDirectory() | |
| 27 const { | |
| 28 base::FilePath path; | |
| 29 if (!PathService::Get(chromeos::DIR_DEVICE_COLOR_CALIBRATION_PROFILES, &path)) | |
| 30 LOG(ERROR) << "Could not get system path for display calibration profiles."; | |
| 31 return path; | |
| 32 } | |
| 33 | |
| 34 // On chrome device, returns /var/cache/display_profiles. | 26 // On chrome device, returns /var/cache/display_profiles. |
| 35 // On Linux desktop, returns {DIR_USER_DATA}/display_profiles. | 27 // On Linux desktop, returns {DIR_USER_DATA}/display_profiles. |
| 36 base::FilePath QuirksManagerDelegateImpl::GetDownloadDisplayProfileDirectory() | 28 base::FilePath QuirksManagerDelegateImpl::GetDisplayProfileDirectory() const { |
| 37 const { | |
| 38 base::FilePath directory; | 29 base::FilePath directory; |
| 39 if (base::SysInfo::IsRunningOnChromeOS()) { | 30 if (base::SysInfo::IsRunningOnChromeOS()) { |
| 40 PathService::Get(chromeos::DIR_DEVICE_DISPLAY_PROFILES, &directory); | 31 PathService::Get(chromeos::DIR_DEVICE_DISPLAY_PROFILES, &directory); |
| 41 } else { | 32 } else { |
| 42 PathService::Get(chrome::DIR_USER_DATA, &directory); | 33 PathService::Get(chrome::DIR_USER_DATA, &directory); |
| 43 directory = directory.Append(kUserDataDisplayProfilesDirectory); | 34 directory = directory.Append(kUserDataDisplayProfilesDirectory); |
| 44 } | 35 } |
| 45 return directory; | 36 return directory; |
| 46 } | 37 } |
| 47 | 38 |
| 48 bool QuirksManagerDelegateImpl::DevicePolicyEnabled() const { | 39 bool QuirksManagerDelegateImpl::DevicePolicyEnabled() const { |
| 49 bool quirks_enabled = true; | 40 bool quirks_enabled = true; |
| 50 chromeos::CrosSettings::Get()->GetBoolean( | 41 chromeos::CrosSettings::Get()->GetBoolean( |
| 51 chromeos::kDeviceQuirksDownloadEnabled, &quirks_enabled); | 42 chromeos::kDeviceQuirksDownloadEnabled, &quirks_enabled); |
| 52 return quirks_enabled; | 43 return quirks_enabled; |
| 53 } | 44 } |
| 54 | 45 |
| 55 } // namespace quirks | 46 } // namespace quirks |
| OLD | NEW |