Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef UI_DISPLAY_TYPES_DISPLAY_MODE_H_ | 5 #ifndef UI_DISPLAY_TYPES_DISPLAY_MODE_H_ |
| 6 #define UI_DISPLAY_TYPES_DISPLAY_MODE_H_ | 6 #define UI_DISPLAY_TYPES_DISPLAY_MODE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "ui/display/types/display_types_export.h" | 13 #include "ui/display/types/display_types_export.h" |
| 14 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 15 | 15 |
| 16 namespace display { | 16 namespace display { |
| 17 | 17 |
| 18 // This class represents the basic information for a native mode. Platforms will | 18 // This class represents the basic information for a native mode. Platforms will |
| 19 // extend this class to add platform specific information about the mode. | 19 // extend this class to add platform specific information about the mode. |
| 20 class DISPLAY_TYPES_EXPORT DisplayMode { | 20 class DISPLAY_TYPES_EXPORT DisplayMode { |
| 21 public: | 21 public: |
| 22 DisplayMode(const gfx::Size& size, bool interlaced, float refresh_rate); | 22 DisplayMode(const gfx::Size& size, bool interlaced, float refresh_rate); |
| 23 virtual ~DisplayMode(); | 23 virtual ~DisplayMode(); |
| 24 virtual std::unique_ptr<DisplayMode> Clone() const; | 24 virtual std::unique_ptr<DisplayMode> Clone() const; |
| 25 | 25 |
| 26 const gfx::Size& size() const { return size_; } | 26 const gfx::Size& size() const { return size_; } |
| 27 bool is_interlaced() const { return is_interlaced_; } | 27 bool is_interlaced() const { return is_interlaced_; } |
| 28 float refresh_rate() const { return refresh_rate_; } | 28 float refresh_rate() const { return refresh_rate_; } |
| 29 | 29 bool operator==(const DisplayMode& other) const; |
|
kylechar
2017/02/14 21:35:28
https://google.github.io/styleguide/cppguide.html#
thanhph1
2017/02/15 15:37:56
Done.
| |
| 30 bool operator!=(const DisplayMode& other) const; | |
| 30 virtual std::string ToString() const; | 31 virtual std::string ToString() const; |
| 31 | 32 |
| 32 private: | 33 private: |
| 33 gfx::Size size_; | 34 gfx::Size size_; |
| 34 bool is_interlaced_; | 35 bool is_interlaced_; |
| 35 float refresh_rate_; | 36 float refresh_rate_; |
| 36 | 37 |
| 37 DISALLOW_COPY_AND_ASSIGN(DisplayMode); | 38 DISALLOW_COPY_AND_ASSIGN(DisplayMode); |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 // Used to by gtest to print readable errors. | 41 // Used to by gtest to print readable errors. |
| 41 DISPLAY_TYPES_EXPORT void PrintTo(const DisplayMode& mode, std::ostream* os); | 42 DISPLAY_TYPES_EXPORT void PrintTo(const DisplayMode& mode, std::ostream* os); |
| 42 | 43 |
| 43 } // namespace display | 44 } // namespace display |
| 44 | 45 |
| 45 #endif // UI_DISPLAY_TYPES_DISPLAY_MODE_H_ | 46 #endif // UI_DISPLAY_TYPES_DISPLAY_MODE_H_ |
| OLD | NEW |