OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/display/display_manager.h" | 5 #include "ash/display/display_manager.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "ash/ash_switches.h" | 12 #include "ash/ash_switches.h" |
13 #include "ash/display/display_layout_store.h" | 13 #include "ash/display/display_layout_store.h" |
14 #include "ash/display/screen_ash.h" | 14 #include "ash/display/screen_ash.h" |
15 #include "ash/screen_util.h" | 15 #include "ash/screen_util.h" |
16 #include "ash/shell.h" | 16 #include "ash/shell.h" |
17 #include "base/auto_reset.h" | 17 #include "base/auto_reset.h" |
18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/metrics/histogram.h" |
20 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
22 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
23 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
24 #include "grit/ash_strings.h" | 25 #include "grit/ash_strings.h" |
25 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
26 #include "ui/gfx/display.h" | 27 #include "ui/gfx/display.h" |
27 #include "ui/gfx/rect.h" | 28 #include "ui/gfx/rect.h" |
28 #include "ui/gfx/screen.h" | 29 #include "ui/gfx/screen.h" |
29 #include "ui/gfx/size_conversions.h" | 30 #include "ui/gfx/size_conversions.h" |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 ui::ColorCalibrationProfile profile) { | 510 ui::ColorCalibrationProfile profile) { |
510 #if defined(OS_CHROMEOS) | 511 #if defined(OS_CHROMEOS) |
511 if (!display_info_[display_id].IsColorProfileAvailable(profile)) | 512 if (!display_info_[display_id].IsColorProfileAvailable(profile)) |
512 return; | 513 return; |
513 | 514 |
514 if (delegate_) | 515 if (delegate_) |
515 delegate_->PreDisplayConfigurationChange(false); | 516 delegate_->PreDisplayConfigurationChange(false); |
516 if (Shell::GetInstance()->output_configurator()->SetColorCalibrationProfile( | 517 if (Shell::GetInstance()->output_configurator()->SetColorCalibrationProfile( |
517 display_id, profile)) { | 518 display_id, profile)) { |
518 display_info_[display_id].SetColorProfile(profile); | 519 display_info_[display_id].SetColorProfile(profile); |
| 520 UMA_HISTOGRAM_ENUMERATION( |
| 521 "ChromeOS.Display.ColorProfile", profile, ui::NUM_COLOR_PROFILES); |
519 } | 522 } |
520 if (delegate_) | 523 if (delegate_) |
521 delegate_->PostDisplayConfigurationChange(); | 524 delegate_->PostDisplayConfigurationChange(); |
522 #endif | 525 #endif |
523 } | 526 } |
524 | 527 |
525 void DisplayManager::OnNativeDisplaysChanged( | 528 void DisplayManager::OnNativeDisplaysChanged( |
526 const std::vector<DisplayInfo>& updated_displays) { | 529 const std::vector<DisplayInfo>& updated_displays) { |
527 if (updated_displays.empty()) { | 530 if (updated_displays.empty()) { |
528 VLOG(1) << "OnNativeDisplayChanged(0): # of current displays=" | 531 VLOG(1) << "OnNativeDisplayChanged(0): # of current displays=" |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 break; | 1110 break; |
1108 } | 1111 } |
1109 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); | 1112 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); |
1110 secondary_display->set_bounds( | 1113 secondary_display->set_bounds( |
1111 gfx::Rect(new_secondary_origin, secondary_bounds.size())); | 1114 gfx::Rect(new_secondary_origin, secondary_bounds.size())); |
1112 secondary_display->UpdateWorkAreaFromInsets(insets); | 1115 secondary_display->UpdateWorkAreaFromInsets(insets); |
1113 } | 1116 } |
1114 | 1117 |
1115 } // namespace internal | 1118 } // namespace internal |
1116 } // namespace ash | 1119 } // namespace ash |
OLD | NEW |