Chromium Code Reviews| Index: ui/gfx/display.cc |
| diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc |
| index 40608a1d21127d265463131cb069199d6015942b..870d44a129b97558a8deaf137a6cbac7e15c6d22 100644 |
| --- a/ui/gfx/display.cc |
| +++ b/ui/gfx/display.cc |
| @@ -32,7 +32,8 @@ float GetForcedDeviceScaleFactorImpl() { |
| return static_cast<float>(scale_in_double); |
| } |
| -} // namespace |
| +int64 internal_display_id_ = Display::kInvalidDisplayID; |
|
oshima
2013/02/14 21:01:33
Sorry for not catching this. This doesn't work (it
ynovikov
2013/02/15 17:42:42
Done.
(That's why I've split the anonymous namespa
|
| +} // namespace |
| const int64 Display::kInvalidDisplayID = -1; |
| @@ -129,11 +130,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 |