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

Unified Diff: ui/display/mojo/display_snapshot_mojo.cc

Issue 2646213002: Write mojom and StructTraits for DisplaySnapshot. (Closed)
Patch Set: use filepath mojom Created 3 years, 10 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
Index: ui/display/mojo/display_snapshot_mojo.cc
diff --git a/ui/display/mojo/display_snapshot_mojo.cc b/ui/display/mojo/display_snapshot_mojo.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3075c33cedb8e85f7259f82dc1ea497cb6a2a9b7
--- /dev/null
+++ b/ui/display/mojo/display_snapshot_mojo.cc
@@ -0,0 +1,71 @@
+// Copyright 2017 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 UI_DISPLAY_MOJO_DISPLAY_SNAPSHOT_MOJO_CC_
+#define UI_DISPLAY_MOJO_DISPLAY_SNAPSHOT_MOJO_CC_
+
+#include "ui/display/mojo/display_snapshot_mojo.h"
+
+#include "ui/display/types/display_constants.h"
+
+namespace display {
+
+DisplaySnapshotMojo::DisplaySnapshotMojo()
+ : DisplaySnapshot(
+ 0,
+ gfx::Point(),
+ gfx::Size(),
+ DisplayConnectionType::DISPLAY_CONNECTION_TYPE_NONE,
+ false, // is_aspect_preserving_scaling
+ false, // has_overscan
+ false, // has_color_correction_zmatrix
+ "", // display_name
+ base::FilePath(),
+ std::vector<std::unique_ptr<const DisplayMode>>(0), // modes
+ std::vector<uint8_t>(0), // edid
+ nullptr, // current_mode
+ nullptr // native_mode
+ ) {
+ product_id_ = 0;
+}
+
+DisplaySnapshotMojo::DisplaySnapshotMojo(int64_t display_id,
+ const gfx::Point& origin,
+ const gfx::Size& physical_size,
+ DisplayConnectionType type,
+ bool is_aspect_preserving_scaling,
+ bool has_overscan,
+ bool has_color_correction_matrix,
+ std::string display_name,
+ const base::FilePath& sys_path,
+ int64_t product_id,
+ DisplayModeList modes,
+ const std::vector<uint8_t>& edid,
+ const DisplayMode* current_mode,
+ const DisplayMode* native_mode)
+ : DisplaySnapshot(display_id,
+ origin,
+ physical_size,
+ type,
+ is_aspect_preserving_scaling,
+ has_overscan,
+ has_color_correction_matrix,
+ display_name,
+ sys_path,
+ std::move(modes),
+ edid,
+ current_mode,
+ native_mode) {
+ product_id_ = product_id;
+}
+
+DisplaySnapshotMojo::~DisplaySnapshotMojo() = default;
+
+std::string DisplaySnapshotMojo::ToString() const {
kylechar 2017/02/10 21:40:29 This isn't ideal, although I'd be fine if you just
thanhph1 2017/02/13 20:09:11 I'll put a TODO here. I can refactor if necessary
+ return "";
+}
+
+} // namespace display
+
+#endif // UI_DISPLAY_MOJO_DISPLAY_SNAPSHOT_MOJO_CC_

Powered by Google App Engine
This is Rietveld 408576698