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

Side by Side Diff: ui/display/types/display_mode.cc

Issue 2636073002: Create mojom and StructTraits for ui/display/types/display_mode.cc (Closed)
Patch Set: add dep on mojo/public/cpp/bindings:struct_traits 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 unified diff | Download patch
« ui/display/mojo/OWNERS ('K') | « ui/display/types/display_mode.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/display/types/display_mode.h" 5 #include "ui/display/types/display_mode.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 9
10 namespace display { 10 namespace display {
11 11
12 DisplayMode::DisplayMode()
13 : size_(gfx::Size()), is_interlaced_(false), refresh_rate_(0.0) {}
14
12 DisplayMode::DisplayMode(const gfx::Size& size, 15 DisplayMode::DisplayMode(const gfx::Size& size,
13 bool interlaced, 16 bool interlaced,
14 float refresh_rate) 17 float refresh_rate)
15 : size_(size), 18 : size_(size),
16 is_interlaced_(interlaced), 19 is_interlaced_(interlaced),
17 refresh_rate_(refresh_rate) {} 20 refresh_rate_(refresh_rate) {}
18 21
19 DisplayMode::~DisplayMode() {} 22 DisplayMode::DisplayMode(DisplayMode&&) = default;
23
24 DisplayMode& DisplayMode::operator=(DisplayMode&&) = default;
25
26 DisplayMode::~DisplayMode() = default;
20 27
21 std::unique_ptr<DisplayMode> DisplayMode::Clone() const { 28 std::unique_ptr<DisplayMode> DisplayMode::Clone() const {
22 return base::WrapUnique(new DisplayMode(size_, 29 return base::WrapUnique(new DisplayMode(size_,
23 is_interlaced_, 30 is_interlaced_,
24 refresh_rate_)); 31 refresh_rate_));
25 } 32 }
26 33
27 std::string DisplayMode::ToString() const { 34 std::string DisplayMode::ToString() const {
28 return base::StringPrintf("[%dx%d %srate=%f]", 35 return base::StringPrintf("[%dx%d %srate=%f]",
29 size_.width(), 36 size_.width(),
30 size_.height(), 37 size_.height(),
31 is_interlaced_ ? "interlaced " : "", 38 is_interlaced_ ? "interlaced " : "",
32 refresh_rate_); 39 refresh_rate_);
33 } 40 }
34 41
35 void PrintTo(const DisplayMode& mode, std::ostream* os) { 42 void PrintTo(const DisplayMode& mode, std::ostream* os) {
36 *os << mode.ToString(); 43 *os << mode.ToString();
37 } 44 }
38 45
39 } // namespace display 46 } // namespace display
OLDNEW
« ui/display/mojo/OWNERS ('K') | « ui/display/types/display_mode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698