Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Side by Side Diff: ash/display/display_manager.cc

Issue 204813006: Adds UMA for display color calibration in ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix failure Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/display/display_preferences.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/display/display_preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698