| 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/display_configurator.h" | 5 #include "ui/display/chromeos/display_configurator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 for (const DisplaySnapshot* display : cached_displays_) { | 736 for (const DisplaySnapshot* display : cached_displays_) { |
| 737 if (display->display_id() == display_id) { | 737 if (display->display_id() == display_id) { |
| 738 return native_display_delegate_->SetColorCalibrationProfile(*display, | 738 return native_display_delegate_->SetColorCalibrationProfile(*display, |
| 739 new_profile); | 739 new_profile); |
| 740 } | 740 } |
| 741 } | 741 } |
| 742 | 742 |
| 743 return false; | 743 return false; |
| 744 } | 744 } |
| 745 | 745 |
| 746 bool DisplayConfigurator::SetGammaRamp(int64_t display_id, |
| 747 const std::vector<uint16_t>& r, |
| 748 const std::vector<uint16_t>& g, |
| 749 const std::vector<uint16_t>& b) { |
| 750 for (const DisplaySnapshot* display : cached_displays_) { |
| 751 if (display->display_id() == display_id) |
| 752 return native_display_delegate_->SetGammaRamp(*display, r, g, b); |
| 753 } |
| 754 |
| 755 return false; |
| 756 } |
| 757 |
| 746 void DisplayConfigurator::PrepareForExit() { | 758 void DisplayConfigurator::PrepareForExit() { |
| 747 configure_display_ = false; | 759 configure_display_ = false; |
| 748 } | 760 } |
| 749 | 761 |
| 750 void DisplayConfigurator::SetDisplayPower( | 762 void DisplayConfigurator::SetDisplayPower( |
| 751 chromeos::DisplayPowerState power_state, | 763 chromeos::DisplayPowerState power_state, |
| 752 int flags, | 764 int flags, |
| 753 const ConfigurationCallback& callback) { | 765 const ConfigurationCallback& callback) { |
| 754 if (!configure_display_ || display_externally_controlled_) { | 766 if (!configure_display_ || display_externally_controlled_) { |
| 755 callback.Run(false); | 767 callback.Run(false); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 FOR_EACH_OBSERVER( | 1013 FOR_EACH_OBSERVER( |
| 1002 Observer, observers_, OnDisplayModeChanged(cached_displays_)); | 1014 Observer, observers_, OnDisplayModeChanged(cached_displays_)); |
| 1003 } else { | 1015 } else { |
| 1004 FOR_EACH_OBSERVER( | 1016 FOR_EACH_OBSERVER( |
| 1005 Observer, observers_, OnDisplayModeChangeFailed(cached_displays_, | 1017 Observer, observers_, OnDisplayModeChangeFailed(cached_displays_, |
| 1006 attempted_state)); | 1018 attempted_state)); |
| 1007 } | 1019 } |
| 1008 } | 1020 } |
| 1009 | 1021 |
| 1010 } // namespace ui | 1022 } // namespace ui |
| OLD | NEW |