summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorglevin <glevin@chromium.org>2016-03-23 16:08:12 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-23 23:10:03 +0000
commit5dd01a7d4eecdf094fad69b07040fdf9f7ce9721 (patch)
tree23194f091df4617f3881870036d6bacb8bd234f9 /chromeos
parent0a2a0e15f6741225fbce75cfc4fa07db0a00190d (diff)
downloadchromium_src-5dd01a7d4eecdf094fad69b07040fdf9f7ce9721.zip
chromium_src-5dd01a7d4eecdf094fad69b07040fdf9f7ce9721.tar.gz
chromium_src-5dd01a7d4eecdf094fad69b07040fdf9f7ce9721.tar.bz2
Creating a "Quirks Client" to download icc files and other display info
("quirks") from a Quirks Server. These provide display-specific tuning (e.g. gamma ramps) on a per-monitor basis. Each Quirks Client handles downloading and writing a single file. The single Quirks Manager handles external requests for file paths, creates clients when downloads are needed, and manages their life cycle. For more info, see go/cros-quirks-client-dd (particularly the "Code Design" section). BUG=549349 TEST=Start up device that has a an icc file on the Quirks Server, check that file is downloaded to /var/cache/display_profiles. At next startup, the gamma correction in the icc file should be applied to the display (this will only be visible to the degree that the gamma correction is large enough to be noticeable; the correct functioning of the Quirks Client is primarily determined by the appearance of the file). Review URL: https://codereview.chromium.org/1528963002 Cr-Commit-Position: refs/heads/master@{#382962}
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/chromeos_paths.cc10
-rw-r--r--chromeos/chromeos_paths.h6
-rw-r--r--chromeos/chromeos_pref_names.cc4
-rw-r--r--chromeos/chromeos_pref_names.h1
4 files changed, 17 insertions, 4 deletions
diff --git a/chromeos/chromeos_paths.cc b/chromeos/chromeos_paths.cc
index 64005cc..58c4f20 100644
--- a/chromeos/chromeos_paths.cc
+++ b/chromeos/chromeos_paths.cc
@@ -47,12 +47,15 @@ const base::FilePath::CharType kDeviceLocalAccountExternalDataDir[] =
const base::FilePath::CharType kDeviceLocalAccountComponentPolicy[] =
FILE_PATH_LITERAL("/var/cache/device_local_account_component_policy");
-const base::FilePath::CharType kDeviceExtensionLocalCache[] =
- FILE_PATH_LITERAL("/var/cache/external_cache");
+const base::FilePath::CharType kDeviceDisplayProfileDirectory[] =
+ FILE_PATH_LITERAL("/var/cache/display_profiles");
const base::FilePath::CharType kDeviceColorProfileDirectory[] =
FILE_PATH_LITERAL("/usr/share/color/icc");
+const base::FilePath::CharType kDeviceExtensionLocalCache[] =
+ FILE_PATH_LITERAL("/var/cache/external_cache");
+
bool PathProvider(int key, base::FilePath* result) {
switch (key) {
case FILE_DEFAULT_APP_ORDER:
@@ -85,6 +88,9 @@ bool PathProvider(int key, base::FilePath* result) {
case DIR_DEVICE_LOCAL_ACCOUNT_COMPONENT_POLICY:
*result = base::FilePath(kDeviceLocalAccountComponentPolicy);
break;
+ case DIR_DEVICE_DISPLAY_PROFILES:
+ *result = base::FilePath(kDeviceDisplayProfileDirectory);
+ break;
case DIR_DEVICE_COLOR_CALIBRATION_PROFILES:
*result = base::FilePath(kDeviceColorProfileDirectory);
break;
diff --git a/chromeos/chromeos_paths.h b/chromeos/chromeos_paths.h
index 95fdcfa..297e68a 100644
--- a/chromeos/chromeos_paths.h
+++ b/chromeos/chromeos_paths.h
@@ -44,8 +44,10 @@ enum {
// device-local accounts.
// Currently this is used for
// policy for extensions.
- DIR_DEVICE_COLOR_CALIBRATION_PROFILES, // Directory where system color
- // calibration files can be found.
+ DIR_DEVICE_DISPLAY_PROFILES, // Destination directory for system display
+ // profiles downloaded from Quirks Server.
+ DIR_DEVICE_COLOR_CALIBRATION_PROFILES, // Directory where system color
+ // calibration files can be found.
DIR_DEVICE_EXTENSION_LOCAL_CACHE, // Directory where extension local cache
// is stored.
PATH_END
diff --git a/chromeos/chromeos_pref_names.cc b/chromeos/chromeos_pref_names.cc
index aaa9120..a7b905d 100644
--- a/chromeos/chromeos_pref_names.cc
+++ b/chromeos/chromeos_pref_names.cc
@@ -38,6 +38,10 @@ const char kAudioVolumePercent[] = "settings.audio.volume_percent";
// as the active one for audio I/O, or it's a new plugged device.
const char kAudioDevicesState[] = "settings.audio.device_state";
+// A dictionary of info for Quirks Client/Server interaction, mostly last server
+// request times, keyed to display product_id's.
+const char kQuirksClientLastServerCheck[] = "quirks_client.last_server_check";
+
} // namespace prefs
} // namespace chromeos
diff --git a/chromeos/chromeos_pref_names.h b/chromeos/chromeos_pref_names.h
index adb8aac..db86a4f 100644
--- a/chromeos/chromeos_pref_names.h
+++ b/chromeos/chromeos_pref_names.h
@@ -16,6 +16,7 @@ CHROMEOS_EXPORT extern const char kAudioMute[];
CHROMEOS_EXPORT extern const char kAudioOutputAllowed[];
CHROMEOS_EXPORT extern const char kAudioVolumePercent[];
CHROMEOS_EXPORT extern const char kAudioDevicesState[];
+CHROMEOS_EXPORT extern const char kQuirksClientLastServerCheck[];
} // namespace prefs
} // namespace chromeos