| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/display/fake_display_snapshot.h" | 5 #include "ui/display/fake_display_snapshot.h" |
| 6 | 6 |
| 7 #include <inttypes.h> | 7 #include <inttypes.h> |
| 8 | 8 |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 } // namespace | 177 } // namespace |
| 178 | 178 |
| 179 using Builder = FakeDisplaySnapshot::Builder; | 179 using Builder = FakeDisplaySnapshot::Builder; |
| 180 | 180 |
| 181 Builder::Builder() {} | 181 Builder::Builder() {} |
| 182 | 182 |
| 183 Builder::~Builder() {} | 183 Builder::~Builder() {} |
| 184 | 184 |
| 185 std::unique_ptr<FakeDisplaySnapshot> Builder::Build() { | 185 std::unique_ptr<FakeDisplaySnapshot> Builder::Build() { |
| 186 if (modes_.empty() || id_ == Display::kInvalidDisplayID) { | 186 if (modes_.empty() || id_ == kInvalidDisplayId) { |
| 187 NOTREACHED() << "Display modes or display ID missing"; | 187 NOTREACHED() << "Display modes or display ID missing"; |
| 188 return nullptr; | 188 return nullptr; |
| 189 } | 189 } |
| 190 | 190 |
| 191 // If there is no native mode set, use the first display mode. | 191 // If there is no native mode set, use the first display mode. |
| 192 if (!native_mode_) | 192 if (!native_mode_) |
| 193 native_mode_ = modes_.back().get(); | 193 native_mode_ = modes_.back().get(); |
| 194 | 194 |
| 195 // Calculate physical size to match set DPI. | 195 // Calculate physical size to match set DPI. |
| 196 gfx::Size physical_size = | 196 gfx::Size physical_size = |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 " physical_size=%s, type=%s name=\"%s\" modes=(%s)", | 377 " physical_size=%s, type=%s name=\"%s\" modes=(%s)", |
| 378 display_id_, | 378 display_id_, |
| 379 current_mode_ ? current_mode_->ToString().c_str() : "nullptr", | 379 current_mode_ ? current_mode_->ToString().c_str() : "nullptr", |
| 380 native_mode_ ? native_mode_->ToString().c_str() : "nullptr", | 380 native_mode_ ? native_mode_->ToString().c_str() : "nullptr", |
| 381 origin_.ToString().c_str(), physical_size_.ToString().c_str(), | 381 origin_.ToString().c_str(), physical_size_.ToString().c_str(), |
| 382 DisplayConnectionTypeString(type_).c_str(), display_name_.c_str(), | 382 DisplayConnectionTypeString(type_).c_str(), display_name_.c_str(), |
| 383 ModeListString(modes_).c_str()); | 383 ModeListString(modes_).c_str()); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace display | 386 } // namespace display |
| OLD | NEW |