Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: ui/gfx/display.cc

Issue 12217120: Add IsInternal property to gfx::Display (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Nits + Rebase Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/display.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/gfx/display.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698