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 <stdio.h> | 5 #include <stdio.h> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/display/display_info.h" | 9 #include "ash/display/display_info.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 iter->size.width(), | 298 iter->size.width(), |
299 iter->size.height(), | 299 iter->size.height(), |
300 iter->refresh_rate, | 300 iter->refresh_rate, |
301 iter->interlaced ? 'I' : 'P', | 301 iter->interlaced ? 'I' : 'P', |
302 iter->native ? "(N)" : ""); | 302 iter->native ? "(N)" : ""); |
303 } | 303 } |
304 return ToString() + ", display_modes==" + display_modes_str; | 304 return ToString() + ", display_modes==" + display_modes_str; |
305 } | 305 } |
306 | 306 |
307 void DisplayInfo::SetColorProfile(ui::ColorCalibrationProfile profile) { | 307 void DisplayInfo::SetColorProfile(ui::ColorCalibrationProfile profile) { |
308 if (std::find(available_color_profiles_.begin(), | 308 if (IsColorProfileAvailable(profile)) |
309 available_color_profiles_.end(), | |
310 profile) != available_color_profiles_.end()) { | |
311 color_profile_ = profile; | 309 color_profile_ = profile; |
312 } | 310 } |
| 311 |
| 312 bool DisplayInfo::IsColorProfileAvailable( |
| 313 ui::ColorCalibrationProfile profile) const { |
| 314 return std::find(available_color_profiles_.begin(), |
| 315 available_color_profiles_.end(), |
| 316 profile) != available_color_profiles_.end(); |
313 } | 317 } |
314 | 318 |
315 } // namespace internal | 319 } // namespace internal |
316 } // namespace ash | 320 } // namespace ash |
OLD | NEW |