| Index: ash/content/display/display_color_manager_chromeos.h
|
| diff --git a/ash/content/display/display_color_manager_chromeos.h b/ash/content/display/display_color_manager_chromeos.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b01461b13fba5f53e3e718f1f5c7bdfce871128d
|
| --- /dev/null
|
| +++ b/ash/content/display/display_color_manager_chromeos.h
|
| @@ -0,0 +1,61 @@
|
| +// 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.
|
| +
|
| +#ifndef ASH_DISPLAY_DISPLAY_COLOR_MANAGER_CHROMEOS_H_
|
| +#define ASH_DISPLAY_DISPLAY_COLOR_MANAGER_CHROMEOS_H_
|
| +
|
| +#include <map>
|
| +#include <vector>
|
| +
|
| +#include "ash/ash_export.h"
|
| +#include "base/basictypes.h"
|
| +#include "base/files/file_path.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "ui/display/chromeos/display_configurator.h"
|
| +#include "ui/gfx/display.h"
|
| +#include "ui/gfx/display_observer.h"
|
| +
|
| +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:
|
| + DisplayColorManager(ui::DisplayConfigurator* configurator);
|
| + ~DisplayColorManager() override;
|
| +
|
| + // Overriden from ui::DisplayConfigurator::Observer:
|
| + void OnDisplayModeChanged(
|
| + const ui::DisplayConfigurator::DisplayStateList& outputs) override;
|
| + void OnDisplayModeChangeFailed(
|
| + const ui::DisplayConfigurator::DisplayStateList& displays,
|
| + ui::MultipleDisplayState failed_new_state) override {}
|
| +
|
| + struct ColorCalibrationData {
|
| + ColorCalibrationData();
|
| + ~ColorCalibrationData();
|
| +
|
| + std::vector<uint16_t> r;
|
| + std::vector<uint16_t> g;
|
| + std::vector<uint16_t> b;
|
| + };
|
| +
|
| + private:
|
| + void ApplyDisplayColorCalibration(uint64_t display_id);
|
| + void LoadInternalFromCommandLine();
|
| + void UpdateCalibrationData(
|
| + uint64_t display_id,
|
| + scoped_ptr<DisplayColorManager::ColorCalibrationData> data,
|
| + bool success);
|
| +
|
| + ui::DisplayConfigurator* configurator_;
|
| + std::map<uint64_t, ColorCalibrationData*> calibration_map_;
|
| + DISALLOW_COPY_AND_ASSIGN(DisplayColorManager);
|
| +};
|
| +
|
| +} // namespace ash
|
| +
|
| +#endif // ASH_DISPLAY_DISPLAY_COLOR_MANAGER_CHROMEOS_H_
|
|
|