diff options
author | glevin <glevin@chromium.org> | 2016-03-23 16:08:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-23 23:10:03 +0000 |
commit | 5dd01a7d4eecdf094fad69b07040fdf9f7ce9721 (patch) | |
tree | 23194f091df4617f3881870036d6bacb8bd234f9 /ash/display/display_color_manager_chromeos.h | |
parent | 0a2a0e15f6741225fbce75cfc4fa07db0a00190d (diff) | |
download | chromium_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 'ash/display/display_color_manager_chromeos.h')
-rw-r--r-- | ash/display/display_color_manager_chromeos.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/ash/display/display_color_manager_chromeos.h b/ash/display/display_color_manager_chromeos.h index b434e05..58e2d9c 100644 --- a/ash/display/display_color_manager_chromeos.h +++ b/ash/display/display_color_manager_chromeos.h @@ -14,15 +14,16 @@ #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "base/threading/thread_checker.h" #include "ui/display/chromeos/display_configurator.h" -#include "ui/gfx/display.h" -#include "ui/gfx/display_observer.h" +#include "ui/display/types/display_constants.h" namespace base { class SequencedWorkerPool; } namespace ui { +class DisplaySnapshot; struct GammaRampRGBEntry; } // namespace ui @@ -31,8 +32,7 @@ namespace ash { // An object that observes changes in display configuration applies any color // calibration where needed. class ASH_EXPORT DisplayColorManager - : public ui::DisplayConfigurator::Observer, - public base::SupportsWeakPtr<DisplayColorManager> { + : public ui::DisplayConfigurator::Observer { public: DisplayColorManager(ui::DisplayConfigurator* configurator, base::SequencedWorkerPool* blocking_pool); @@ -52,19 +52,28 @@ class ASH_EXPORT DisplayColorManager std::vector<ui::GammaRampRGBEntry> lut; }; + protected: + virtual void FinishLoadCalibrationForDisplay(int64_t display_id, + int64_t product_id, + ui::DisplayConnectionType type, + const base::FilePath& path, + bool file_downloaded); + virtual void UpdateCalibrationData(int64_t display_id, + int64_t product_id, + scoped_ptr<ColorCalibrationData> data); + private: void ApplyDisplayColorCalibration(int64_t display_id, int64_t product_id); void LoadCalibrationForDisplay(const ui::DisplaySnapshot* display); - void UpdateCalibrationData( - int64_t display_id, - int64_t product_id, - scoped_ptr<DisplayColorManager::ColorCalibrationData> data, - bool success); ui::DisplayConfigurator* configurator_; std::map<int64_t, ColorCalibrationData*> calibration_map_; + base::ThreadChecker thread_checker_; base::SequencedWorkerPool* blocking_pool_; + // Factory for callbacks. + base::WeakPtrFactory<DisplayColorManager> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(DisplayColorManager); }; |