Chromium Code Reviews| Index: ui/display/types/display_mode.cc |
| diff --git a/ui/display/types/display_mode.cc b/ui/display/types/display_mode.cc |
| index 6d43caa5638406c5e43a4b7003d0e491db066715..9874f7af8c168be2ab9991d086acf805bf85eacb 100644 |
| --- a/ui/display/types/display_mode.cc |
| +++ b/ui/display/types/display_mode.cc |
| @@ -18,10 +18,14 @@ DisplayMode::DisplayMode(const gfx::Size& size, |
| DisplayMode::~DisplayMode() {} |
| -std::unique_ptr<DisplayMode> DisplayMode::Clone() const { |
| - return base::WrapUnique(new DisplayMode(size_, |
| - is_interlaced_, |
| - refresh_rate_)); |
| +bool DisplayMode::operator==(const DisplayMode& other) const { |
| + return this->size() == other.size() && |
| + this->is_interlaced() == other.is_interlaced() && |
| + this->refresh_rate() == other.refresh_rate(); |
| +} |
| + |
| +bool DisplayMode::operator!=(const DisplayMode& other) const { |
| + return !operator==(other); |
| } |
| std::string DisplayMode::ToString() const { |
| @@ -32,6 +36,11 @@ std::string DisplayMode::ToString() const { |
| refresh_rate_); |
| } |
| +std::unique_ptr<DisplayMode> DisplayMode::Clone() const { |
|
kylechar
2017/02/15 16:48:45
Please keep the order consistent between header an
thanhph
2017/02/16 11:48:21
Nice catch. Thanks!
|
| + return base::WrapUnique( |
| + new DisplayMode(size_, is_interlaced_, refresh_rate_)); |
| +} |
| + |
| void PrintTo(const DisplayMode& mode, std::ostream* os) { |
| *os << mode.ToString(); |
| } |