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

Unified Diff: ui/gfx/display.cc

Issue 10826198: Use persistent ID/names for displays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove persistent_id() and change id() to int64 Created 8 years, 4 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
« ui/base/x/x11_util.cc ('K') | « 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 6a8bb85fcb75736dc08dfd844d2c2bd8eafa7a6a..57ddaccca746755ffd8e4e8b44e0a41154ae83d7 100644
--- a/ui/gfx/display.cc
+++ b/ui/gfx/display.cc
@@ -39,17 +39,22 @@ float Display::GetForcedDeviceScaleFactor() {
return kForcedDeviceScaleFactor;
}
+// static
+int64 Display::GetID(uint16 manufacturer_id, uint32 serial_number) {
+ return ((static_cast<int64>(manufacturer_id) << 32) | serial_number);
+}
+
Display::Display()
: id_(-1),
device_scale_factor_(GetForcedDeviceScaleFactor()) {
}
-Display::Display(int id)
+Display::Display(int64 id)
: id_(id),
device_scale_factor_(GetForcedDeviceScaleFactor()) {
}
-Display::Display(int id, const gfx::Rect& bounds)
+Display::Display(int64 id, const gfx::Rect& bounds)
: id_(id),
bounds_(bounds),
work_area_(bounds),
@@ -103,8 +108,8 @@ gfx::Size Display::GetSizeInPixel() const {
}
std::string Display::ToString() const {
- return base::StringPrintf("Display[%d] bounds=%s, workarea=%s, scale=%f",
- id_,
+ 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_);
« ui/base/x/x11_util.cc ('K') | « ui/gfx/display.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698