| 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 "base/task_runner_util.h" | |
| 10 #include "base/threading/thread_restrictions.h" | |
| 11 #include "chrome/browser/chromeos/login/startup_utils.h" | |
| 12 #include "chrome/browser/chromeos/settings/cros_settings.h" | 9 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 13 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| 14 #include "chromeos/chromeos_paths.h" | 11 #include "chromeos/chromeos_paths.h" |
| 15 #include "content/public/browser/browser_thread.h" | |
| 16 #include "google_apis/google_api_keys.h" | 12 #include "google_apis/google_api_keys.h" |
| 17 | 13 |
| 18 namespace { | 14 namespace { |
| 19 | 15 |
| 20 const char kUserDataDisplayProfilesDirectory[] = "display_profiles"; | 16 const char kUserDataDisplayProfilesDirectory[] = "display_profiles"; |
| 21 | 17 |
| 22 int GetDaysSinceOobeOnBlockingPool() { | |
| 23 return chromeos::StartupUtils::GetTimeSinceOobeFlagFileCreation().InDays(); | |
| 24 } | |
| 25 | |
| 26 } // namespace | 18 } // namespace |
| 27 | 19 |
| 28 namespace quirks { | 20 namespace quirks { |
| 29 | 21 |
| 30 std::string QuirksManagerDelegateImpl::GetApiKey() const { | 22 std::string QuirksManagerDelegateImpl::GetApiKey() const { |
| 31 return google_apis::GetAPIKey(); | 23 return google_apis::GetAPIKey(); |
| 32 } | 24 } |
| 33 | 25 |
| 34 base::FilePath QuirksManagerDelegateImpl::GetBuiltInDisplayProfileDirectory() | 26 base::FilePath QuirksManagerDelegateImpl::GetBuiltInDisplayProfileDirectory() |
| 35 const { | 27 const { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 53 return directory; | 45 return directory; |
| 54 } | 46 } |
| 55 | 47 |
| 56 bool QuirksManagerDelegateImpl::DevicePolicyEnabled() const { | 48 bool QuirksManagerDelegateImpl::DevicePolicyEnabled() const { |
| 57 bool quirks_enabled = true; | 49 bool quirks_enabled = true; |
| 58 chromeos::CrosSettings::Get()->GetBoolean( | 50 chromeos::CrosSettings::Get()->GetBoolean( |
| 59 chromeos::kDeviceQuirksDownloadEnabled, &quirks_enabled); | 51 chromeos::kDeviceQuirksDownloadEnabled, &quirks_enabled); |
| 60 return quirks_enabled; | 52 return quirks_enabled; |
| 61 } | 53 } |
| 62 | 54 |
| 63 void QuirksManagerDelegateImpl::GetDaysSinceOobe( | |
| 64 QuirksManager::DaysSinceOobeCallback callback) const { | |
| 65 base::PostTaskAndReplyWithResult( | |
| 66 content::BrowserThread::GetBlockingPool(), FROM_HERE, | |
| 67 base::Bind(&GetDaysSinceOobeOnBlockingPool), callback); | |
| 68 } | |
| 69 | |
| 70 } // namespace quirks | 55 } // namespace quirks |
| OLD | NEW |