Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: ui/display/fake_display_snapshot.h

Issue 2395873002: Add more options to --screen-config flag. (Closed)
Patch Set: Fix windows compile Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/fake_display_delegate.cc ('k') | ui/display/fake_display_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/fake_display_snapshot.h
diff --git a/ui/display/fake_display_snapshot.h b/ui/display/fake_display_snapshot.h
index 1f17bf85e91cd60e01030853588bfccdc4052124..7135124d94d484c7bfcd6643e27c2d0c9942c712 100644
--- a/ui/display/fake_display_snapshot.h
+++ b/ui/display/fake_display_snapshot.h
@@ -38,11 +38,21 @@ class DISPLAY_EXPORT FakeDisplaySnapshot : public ui::DisplaySnapshot {
// Adds display mode with |size| and set as native mode. If a display mode
// with |size| already exists then it will be reused.
Builder& SetNativeMode(const gfx::Size& size);
+ // Adds display mode and set as native mode. If an existing display mode is
+ // equivalent to |mode| it will be set as native mode instead.
+ Builder& SetNativeMode(std::unique_ptr<ui::DisplayMode> mode);
// Adds display mode with |size| and set as current mode. If a display mode
// with |size| already exists then it will be reused.
Builder& SetCurrentMode(const gfx::Size& size);
- // Adds display mode with |size| if it doesn't exist.
+ // Adds display mode and set as current mode. If an existing display mode is
+ // equivalent to |mode| it will be set as current mode instead.
+ Builder& SetCurrentMode(std::unique_ptr<ui::DisplayMode> mode);
+ // Adds display mode with |size| if necessary. If a display mode with |size|
+ // already exists then it will be reused.
Builder& AddMode(const gfx::Size& size);
+ // Adds |mode| if necessary. If an existing display mode is equivalent to
+ // |mode| it will not be added.
+ Builder& AddMode(std::unique_ptr<ui::DisplayMode> mode);
Builder& SetOrigin(const gfx::Point& origin);
Builder& SetType(ui::DisplayConnectionType type);
Builder& SetIsAspectPerservingScaling(bool is_aspect_preserving_scaling);
@@ -60,8 +70,12 @@ class DISPLAY_EXPORT FakeDisplaySnapshot : public ui::DisplaySnapshot {
private:
// Returns a display mode with |size|. If there is no existing mode, insert
- // a display mode with |size|.
+ // a display mode with |size| first.
const ui::DisplayMode* AddOrFindDisplayMode(const gfx::Size& size);
+ // Returns a display mode equivalent to |mode|. If there is no equivalent
+ // display mode, insert |mode| first.
+ const ui::DisplayMode* AddOrFindDisplayMode(
+ std::unique_ptr<ui::DisplayMode> mode);
int64_t id_ = Display::kInvalidDisplayID;
gfx::Point origin_;
@@ -72,7 +86,7 @@ class DISPLAY_EXPORT FakeDisplaySnapshot : public ui::DisplaySnapshot {
bool has_color_correction_matrix_ = false;
std::string name_ = "Fake Display";
int64_t product_id_ = DisplaySnapshot::kInvalidProductID;
- std::vector<std::unique_ptr<const ui::DisplayMode>> modes_;
+ DisplayModeList modes_;
const ui::DisplayMode* current_mode_ = nullptr;
const ui::DisplayMode* native_mode_ = nullptr;
@@ -88,11 +102,18 @@ class DISPLAY_EXPORT FakeDisplaySnapshot : public ui::DisplaySnapshot {
bool has_color_correction_matrix,
std::string display_name,
int64_t product_id,
- std::vector<std::unique_ptr<const ui::DisplayMode>> modes,
+ DisplayModeList modes,
const ui::DisplayMode* current_mode,
const ui::DisplayMode* native_mode);
~FakeDisplaySnapshot() override;
+ // Creates a display snapshot from the provided |spec| string. Returns null if
+ // |spec| is invalid. See fake_display_delegate.h for |spec| format
+ // description.
+ static std::unique_ptr<ui::DisplaySnapshot> CreateFromSpec(
+ int64_t id,
+ const std::string& spec);
+
// DisplaySnapshot:
std::string ToString() const override;
« no previous file with comments | « ui/display/fake_display_delegate.cc ('k') | ui/display/fake_display_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698