Index: chrome/browser/chromeos/display/quirks_client_delegate_impl.cc |
diff --git a/chrome/browser/chromeos/display/quirks_client_delegate_impl.cc b/chrome/browser/chromeos/display/quirks_client_delegate_impl.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..29e7e8cd9b7879a97e3e761efa9002460031a152 |
--- /dev/null |
+++ b/chrome/browser/chromeos/display/quirks_client_delegate_impl.cc |
@@ -0,0 +1,39 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/chromeos/display/quirks_client_delegate_impl.h" |
+ |
+#include "base/path_service.h" |
+#include "base/sys_info.h" |
+#include "chrome/browser/chromeos/login/startup_utils.h" |
+#include "chrome/common/chrome_paths.h" |
+#include "chromeos/chromeos_paths.h" |
+#include "google_apis/google_api_keys.h" |
+ |
+namespace quirks_client { |
+ |
+std::string QuirksClientDelegateImpl::api_key_quirks() { |
+ return google_apis::GetAPIKey(); |
+} |
+ |
+// Returns the path to the writable display profile directory. |
stevenjb
2016/01/28 21:05:58
This comment should be in the header.
Greg Levin
2016/02/01 23:17:43
Done.
|
+// On chrome device, returns /var/cache/display_profiles. |
+// On Linux desktop, returns {DIR_USER_DATA}/display_profiles. |
+// Either directory must be created beforehand. |
stevenjb
2016/01/28 21:05:58
s/must be created beforehand/must already exist/
Greg Levin
2016/02/01 23:17:43
Done.
|
+base::FilePath QuirksClientDelegateImpl::GetDisplayProfileDirectory() { |
+ base::FilePath directory; |
+ if (base::SysInfo::IsRunningOnChromeOS()) { |
+ PathService::Get(chromeos::DIR_DEVICE_DISPLAY_PROFILES, &directory); |
+ } else { |
+ PathService::Get(chrome::DIR_USER_DATA, &directory); |
+ directory = directory.Append("display_profiles"); |
+ } |
+ return directory; |
+} |
+ |
+int QuirksClientDelegateImpl::GetDaysSinceOobe() { |
+ return chromeos::StartupUtils::GetTimeSinceOobeFlagFileCreation().InDays(); |
+} |
+ |
+} // namespace quirks_client |