| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/manager/managed_display_info.h" | 5 #include "ui/display/manager/managed_display_info.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <algorithm> | |
| 10 #include <string> | 9 #include <string> |
| 11 #include <vector> | 10 #include <vector> |
| 12 | 11 |
| 13 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/stl_util.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "ui/display/display.h" | 18 #include "ui/display/display.h" |
| 19 #include "ui/gfx/geometry/size_conversions.h" | 19 #include "ui/gfx/geometry/size_conversions.h" |
| 20 #include "ui/gfx/geometry/size_f.h" | 20 #include "ui/gfx/geometry/size_f.h" |
| 21 | 21 |
| 22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
| 23 #include <windows.h> | 23 #include <windows.h> |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 return ToString() + ", display_modes==" + display_modes_str; | 500 return ToString() + ", display_modes==" + display_modes_str; |
| 501 } | 501 } |
| 502 | 502 |
| 503 void ManagedDisplayInfo::SetColorProfile(ColorCalibrationProfile profile) { | 503 void ManagedDisplayInfo::SetColorProfile(ColorCalibrationProfile profile) { |
| 504 if (IsColorProfileAvailable(profile)) | 504 if (IsColorProfileAvailable(profile)) |
| 505 color_profile_ = profile; | 505 color_profile_ = profile; |
| 506 } | 506 } |
| 507 | 507 |
| 508 bool ManagedDisplayInfo::IsColorProfileAvailable( | 508 bool ManagedDisplayInfo::IsColorProfileAvailable( |
| 509 ColorCalibrationProfile profile) const { | 509 ColorCalibrationProfile profile) const { |
| 510 return std::find(available_color_profiles_.begin(), | 510 return base::ContainsValue(available_color_profiles_, profile); |
| 511 available_color_profiles_.end(), | |
| 512 profile) != available_color_profiles_.end(); | |
| 513 } | 511 } |
| 514 | 512 |
| 515 bool ManagedDisplayInfo::Use125DSFForUIScaling() const { | 513 bool ManagedDisplayInfo::Use125DSFForUIScaling() const { |
| 516 return use_125_dsf_for_ui_scaling && Display::IsInternalDisplayId(id_); | 514 return use_125_dsf_for_ui_scaling && Display::IsInternalDisplayId(id_); |
| 517 } | 515 } |
| 518 | 516 |
| 519 void ManagedDisplayInfo::AddInputDevice(int id) { | 517 void ManagedDisplayInfo::AddInputDevice(int id) { |
| 520 input_devices_.push_back(id); | 518 input_devices_.push_back(id); |
| 521 } | 519 } |
| 522 | 520 |
| 523 void ManagedDisplayInfo::ClearInputDevices() { | 521 void ManagedDisplayInfo::ClearInputDevices() { |
| 524 input_devices_.clear(); | 522 input_devices_.clear(); |
| 525 } | 523 } |
| 526 | 524 |
| 527 void ResetDisplayIdForTest() { | 525 void ResetDisplayIdForTest() { |
| 528 synthesized_display_id = kSynthesizedDisplayIdStart; | 526 synthesized_display_id = kSynthesizedDisplayIdStart; |
| 529 } | 527 } |
| 530 | 528 |
| 531 void ManagedDisplayInfo::SetTouchCalibrationData( | 529 void ManagedDisplayInfo::SetTouchCalibrationData( |
| 532 const TouchCalibrationData& touch_calibration_data) { | 530 const TouchCalibrationData& touch_calibration_data) { |
| 533 has_touch_calibration_data_ = true; | 531 has_touch_calibration_data_ = true; |
| 534 touch_calibration_data_ = touch_calibration_data; | 532 touch_calibration_data_ = touch_calibration_data; |
| 535 } | 533 } |
| 536 | 534 |
| 537 } // namespace display | 535 } // namespace display |
| OLD | NEW |