Chromium Code Reviews| Index: ui/gfx/display.cc |
| diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc |
| index 40608a1d21127d265463131cb069199d6015942b..996f618ad7c80504694dd85c55404898db36fd87 100644 |
| --- a/ui/gfx/display.cc |
| +++ b/ui/gfx/display.cc |
| @@ -35,6 +35,9 @@ float GetForcedDeviceScaleFactorImpl() { |
| } // namespace |
|
oshima
2013/02/12 21:39:53
this is nor your fault, but could please fix this?
ynovikov
2013/02/13 13:48:37
Done.
|
| const int64 Display::kInvalidDisplayID = -1; |
| +namespace { |
| + int64 internal_display_id_ = Display::kInvalidDisplayID; |
|
oshima
2013/02/12 21:39:53
indent
ynovikov
2013/02/13 13:48:37
Done.
|
| +} // namespace |
|
oshima
2013/02/12 21:39:53
move this into the anonymous namespace above.
ynovikov
2013/02/13 13:48:37
Done.
|
| // static |
| float Display::GetForcedDeviceScaleFactor() { |
| @@ -129,11 +132,25 @@ gfx::Size Display::GetSizeInPixel() const { |
| } |
| std::string Display::ToString() const { |
| - return base::StringPrintf("Display[%lld] bounds=%s, workarea=%s, scale=%f", |
| - static_cast<long long int>(id_), |
| - bounds_.ToString().c_str(), |
| - work_area_.ToString().c_str(), |
| - device_scale_factor_); |
| + return base::StringPrintf( |
| + "Display[%lld] bounds=%s, workarea=%s, scale=%f, %s", |
| + static_cast<long long int>(id_), |
| + bounds_.ToString().c_str(), |
| + work_area_.ToString().c_str(), |
| + device_scale_factor_, |
| + IsInternal() ? "internal" : "external"); |
| +} |
| + |
| +bool Display::IsInternal() const { |
| + return is_valid() && (id_ == internal_display_id_); |
| +} |
| + |
| +int64 Display::InternalDisplayId() { |
| + return internal_display_id_; |
| +} |
| + |
| +void Display::SetInternalDisplayId(int64 internal_display_id) { |
| + internal_display_id_ = internal_display_id; |
| } |
| } // namespace gfx |