Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / ozone / common / display_util.h
blob898289a960d899a978f5a39f3a054c5609bf212c
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_OZONE_COMMON_DISPLAY_UTIL_H_
6 #define UI_OZONE_COMMON_DISPLAY_UTIL_H_
8 #include <vector>
10 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
12 namespace base {
13 class FilePath;
16 namespace ui {
18 class DisplayMode;
19 class DisplaySnapshot;
21 // Conforms to the std::UnaryPredicate interface such that it can be used to
22 // find a display with |display_id| in std:: containers (ie: std::vector).
23 class FindDisplayById {
24 public:
25 FindDisplayById(int64_t display_id);
27 bool operator()(const DisplaySnapshot_Params& display) const;
29 private:
30 int64_t display_id_;
33 DisplayMode_Params GetDisplayModeParams(const DisplayMode& mode);
34 DisplaySnapshot_Params GetDisplaySnapshotParams(const DisplaySnapshot& display);
36 // Create a display using the Ozone command line parameters.
37 // Return false if the command line flags are not specified.
38 bool CreateSnapshotFromCommandLine(DisplaySnapshot_Params* snapshot_out);
40 // Create a display snapshot from |file| that contains EDID.
41 // Return false if the file doesn't exist, or it doesn't contain valid EDID.
42 bool CreateSnapshotFromEDIDFile(const base::FilePath& file,
43 DisplaySnapshot_Params* snapshot_out);
45 // Create a display snaphot from edid.
46 // Return false if it doesn't contain valid EDID.
47 OZONE_EXPORT bool CreateSnapshotFromEDID(bool internal,
48 const std::vector<uint8_t>& edid,
49 DisplaySnapshot_Params* snapshot_out);
51 } // namespace ui
53 #endif // UI_OZONE_COMMON_DISPLAY_UTIL_H_