| Index: ui/gfx/display.cc
|
| diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc
|
| index 40608a1d21127d265463131cb069199d6015942b..7aa12416b4af84cee4694b556bc6a4bd8099396e 100644
|
| --- a/ui/gfx/display.cc
|
| +++ b/ui/gfx/display.cc
|
| @@ -32,9 +32,11 @@ float GetForcedDeviceScaleFactorImpl() {
|
| return static_cast<float>(scale_in_double);
|
| }
|
|
|
| -} // namespace
|
| +const int64 kInvalidDisplayIDForCompileTimeInit = -1;
|
| +int64 internal_display_id_ = kInvalidDisplayIDForCompileTimeInit;
|
| +} // namespace
|
|
|
| -const int64 Display::kInvalidDisplayID = -1;
|
| +const int64 Display::kInvalidDisplayID = kInvalidDisplayIDForCompileTimeInit;
|
|
|
| // static
|
| float Display::GetForcedDeviceScaleFactor() {
|
| @@ -129,11 +131,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
|
|
|