Chromium Code Reviews| 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 "base/task_runner_util.h" | |
| 10 #include "base/threading/thread_restrictions.h" | |
| 11 #include "chrome/browser/chromeos/login/startup_utils.h" | |
| 12 #include "chrome/common/chrome_paths.h" | |
| 13 #include "chromeos/chromeos_paths.h" | |
| 14 #include "google_apis/google_api_keys.h" | |
| 15 | |
| 16 namespace { | |
| 17 | |
| 18 int GetDaysSinceOobeOnBlockingPool() { | |
| 19 base::ThreadRestrictions::AssertIOAllowed(); | |
| 20 return chromeos::StartupUtils::GetTimeSinceOobeFlagFileCreation().InDays(); | |
| 21 } | |
| 22 } | |
| 23 | |
| 24 namespace quirks { | |
| 25 | |
| 26 std::string QuirksManagerDelegateImpl::GetApiKey() const { | |
| 27 return google_apis::GetAPIKey(); | |
| 28 } | |
| 29 | |
| 30 base::FilePath QuirksManagerDelegateImpl::GetBuiltInDisplayProfileDirectory() | |
| 31 const { | |
| 32 base::FilePath path; | |
| 33 DCHECK( | |
| 34 PathService::Get(chromeos::DIR_DEVICE_COLOR_CALIBRATION_PROFILES, &path)); | |
| 35 return path; | |
| 36 } | |
| 37 | |
| 38 // On chrome device, returns /var/cache/display_profiles. | |
| 39 // On Linux desktop, returns {DIR_USER_DATA}/display_profiles. | |
| 40 base::FilePath QuirksManagerDelegateImpl::GetDownloadDisplayProfileDirectory() | |
| 41 const { | |
| 42 base::FilePath directory; | |
| 43 if (base::SysInfo::IsRunningOnChromeOS()) { | |
| 44 PathService::Get(chromeos::DIR_DEVICE_DISPLAY_PROFILES, &directory); | |
| 45 } else { | |
| 46 PathService::Get(chrome::DIR_USER_DATA, &directory); | |
| 47 directory = directory.Append("display_profiles"); | |
| 48 } | |
| 49 return directory; | |
| 50 } | |
| 51 | |
| 52 void QuirksManagerDelegateImpl::GetDaysSinceOobe( | |
| 53 scoped_refptr<base::SequencedWorkerPool> blocking_pool, | |
| 54 QuirksManager::DaysSinceOobeCallback callback) const { | |
| 55 base::PostTaskAndReplyWithResult(blocking_pool.get(), FROM_HERE, | |
|
stevenjb
2016/03/08 22:38:06
No need to pass blocking_pool to this. There is no
Greg Levin
2016/03/09 22:46:16
Done.
| |
| 56 base::Bind(&GetDaysSinceOobeOnBlockingPool), | |
| 57 callback); | |
| 58 } | |
| 59 | |
| 60 } // namespace quirks | |
| OLD | NEW |