| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/display/quirks_manager_delegate_impl.h" |
| 6 |
| 7 #include "base/path_service.h" |
| 8 #include "base/sys_info.h" |
| 9 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 10 #include "chrome/common/chrome_paths.h" |
| 11 #include "chromeos/chromeos_paths.h" |
| 12 #include "google_apis/google_api_keys.h" |
| 13 |
| 14 namespace { |
| 15 |
| 16 // Value to indicate uninitialized. |
| 17 const int kDaysSinceOobeUninitialized = -1; |
| 18 } |
| 19 |
| 20 namespace quirks { |
| 21 |
| 22 QuirksManagerDelegateImpl::QuirksManagerDelegateImpl() |
| 23 : days_since_oobe_(kDaysSinceOobeUninitialized) {} |
| 24 |
| 25 std::string QuirksManagerDelegateImpl::GetApiKey() const { |
| 26 return google_apis::GetAPIKey(); |
| 27 } |
| 28 |
| 29 base::FilePath QuirksManagerDelegateImpl::GetBuiltInDisplayProfileDirectory() |
| 30 const { |
| 31 base::FilePath path; |
| 32 DCHECK( |
| 33 PathService::Get(chromeos::DIR_DEVICE_COLOR_CALIBRATION_PROFILES, &path)); |
| 34 return path; |
| 35 } |
| 36 |
| 37 base::FilePath QuirksManagerDelegateImpl::GetDownloadDisplayProfileDirectory() |
| 38 const { |
| 39 base::FilePath directory; |
| 40 if (base::SysInfo::IsRunningOnChromeOS()) { |
| 41 PathService::Get(chromeos::DIR_DEVICE_DISPLAY_PROFILES, &directory); |
| 42 } else { |
| 43 PathService::Get(chrome::DIR_USER_DATA, &directory); |
| 44 directory = directory.Append("display_profiles"); |
| 45 } |
| 46 return directory; |
| 47 } |
| 48 |
| 49 void QuirksManagerDelegateImpl::CheckDaysSinceOobe() { |
| 50 days_since_oobe_ = |
| 51 chromeos::StartupUtils::GetTimeSinceOobeFlagFileCreation().InDays(); |
| 52 } |
| 53 |
| 54 int QuirksManagerDelegateImpl::GetDaysSinceOobe() const { |
| 55 return days_since_oobe_; |
| 56 } |
| 57 |
| 58 } // namespace quirks |
| OLD | NEW |