Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/output_configurator.h" | 5 #include "ui/display/chromeos/output_configurator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | |
| 9 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 11 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 13 #include "ui/display/chromeos/display_mode.h" | 14 #include "ui/display/chromeos/display_mode.h" |
| 14 #include "ui/display/chromeos/display_snapshot.h" | 15 #include "ui/display/chromeos/display_snapshot.h" |
| 15 #include "ui/display/chromeos/x11/native_display_delegate_x11.h" | 16 #include "ui/display/chromeos/x11/native_display_delegate_x11.h" |
| 16 #include "ui/display/chromeos/x11/touchscreen_delegate_x11.h" | 17 #include "ui/display/chromeos/x11/touchscreen_delegate_x11.h" |
| 17 | 18 |
| 18 namespace ui { | 19 namespace ui { |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 392 | 393 |
| 393 return std::vector<ui::ColorCalibrationProfile>(); | 394 return std::vector<ui::ColorCalibrationProfile>(); |
| 394 } | 395 } |
| 395 | 396 |
| 396 bool OutputConfigurator::SetColorCalibrationProfile( | 397 bool OutputConfigurator::SetColorCalibrationProfile( |
| 397 int64 display_id, | 398 int64 display_id, |
| 398 ui::ColorCalibrationProfile new_profile) { | 399 ui::ColorCalibrationProfile new_profile) { |
| 399 for (size_t i = 0; i < cached_outputs_.size(); ++i) { | 400 for (size_t i = 0; i < cached_outputs_.size(); ++i) { |
| 400 if (cached_outputs_[i].display && | 401 if (cached_outputs_[i].display && |
| 401 cached_outputs_[i].display->display_id() == display_id) { | 402 cached_outputs_[i].display->display_id() == display_id) { |
| 402 return native_display_delegate_->SetColorCalibrationProfile( | 403 bool succeed = native_display_delegate_->SetColorCalibrationProfile( |
| 403 *cached_outputs_[i].display, new_profile); | 404 *cached_outputs_[i].display, new_profile); |
| 405 if (succeed) { | |
| 406 UMA_HISTOGRAM_ENUMERATION( | |
| 407 "ChromeOS.Display.ColorProfile", | |
| 408 new_profile, | |
| 409 COLOR_PROFILE_READING + 1); | |
|
Alexei Svitkine (slow)
2014/03/26 13:02:10
Can you add a new enum at the end for the size ins
Jun Mukai
2014/03/26 18:08:09
Done.
| |
| 410 } | |
| 411 return succeed; | |
| 404 } | 412 } |
| 405 } | 413 } |
| 406 | 414 |
| 407 return false; | 415 return false; |
| 408 } | 416 } |
| 409 | 417 |
| 410 void OutputConfigurator::PrepareForExit() { | 418 void OutputConfigurator::PrepareForExit() { |
| 411 configure_display_ = false; | 419 configure_display_ = false; |
| 412 } | 420 } |
| 413 | 421 |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1022 float width_ratio = static_cast<float>(mirror_mode_info->size().width()) / | 1030 float width_ratio = static_cast<float>(mirror_mode_info->size().width()) / |
| 1023 static_cast<float>(native_mode_info->size().width()); | 1031 static_cast<float>(native_mode_info->size().width()); |
| 1024 float height_ratio = static_cast<float>(mirror_mode_info->size().height()) / | 1032 float height_ratio = static_cast<float>(mirror_mode_info->size().height()) / |
| 1025 static_cast<float>(native_mode_info->size().height()); | 1033 static_cast<float>(native_mode_info->size().height()); |
| 1026 | 1034 |
| 1027 area_ratio = width_ratio * height_ratio; | 1035 area_ratio = width_ratio * height_ratio; |
| 1028 return area_ratio; | 1036 return area_ratio; |
| 1029 } | 1037 } |
| 1030 | 1038 |
| 1031 } // namespace ui | 1039 } // namespace ui |
| OLD | NEW |