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

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

Issue 2646213002: Write mojom and StructTraits for DisplaySnapshot. (Closed)
Patch Set: use FILE_PATH_LITERAL to create base::FilePath::StringType 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..8886d47d6b6d8ad1d3543c269097873b8f7c67a9
--- /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"
kylechar 2017/02/09 15:05:53 You use DisplayConnectionType in the header, move
thanhph1 2017/02/10 19:54:32 Done.
+
+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 {
+ return "DisplaySnapshotMojo";
kylechar 2017/02/09 15:05:54 This isn't super useful.
thanhph1 2017/02/10 19:54:32 I put return "".
+}
+
+} // namespace display
+
+#endif // UI_DISPLAY_MOJO_DISPLAY_SNAPSHOT_MOJO_CC_

Powered by Google App Engine
This is Rietveld 408576698