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

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

Issue 208943002: Refactors getting available color profiles code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
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>
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 std::map<int64, DisplayInfo>::const_iterator it = 501 std::map<int64, DisplayInfo>::const_iterator it =
502 display_info_.find(display_id); 502 display_info_.find(display_id);
503 return (it != display_info_.end()) ? 503 return (it != display_info_.end()) ?
504 it->second.overscan_insets_in_dip() : gfx::Insets(); 504 it->second.overscan_insets_in_dip() : gfx::Insets();
505 } 505 }
506 506
507 void DisplayManager::SetColorCalibrationProfile( 507 void DisplayManager::SetColorCalibrationProfile(
508 int64 display_id, 508 int64 display_id,
509 ui::ColorCalibrationProfile profile) { 509 ui::ColorCalibrationProfile profile) {
510 #if defined(OS_CHROMEOS) 510 #if defined(OS_CHROMEOS)
511 if (!display_info_[display_id].IsColorProfileAvailable(profile))
512 return;
513
511 if (delegate_) 514 if (delegate_)
512 delegate_->PreDisplayConfigurationChange(false); 515 delegate_->PreDisplayConfigurationChange(false);
513 if (Shell::GetInstance()->output_configurator()->SetColorCalibrationProfile( 516 if (Shell::GetInstance()->output_configurator()->SetColorCalibrationProfile(
514 display_id, profile)) { 517 display_id, profile)) {
515 display_info_[display_id].SetColorProfile(profile); 518 display_info_[display_id].SetColorProfile(profile);
516 } 519 }
517 if (delegate_) 520 if (delegate_)
518 delegate_->PostDisplayConfigurationChange(); 521 delegate_->PostDisplayConfigurationChange();
519 #endif 522 #endif
520 } 523 }
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 break; 1107 break;
1105 } 1108 }
1106 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); 1109 gfx::Insets insets = secondary_display->GetWorkAreaInsets();
1107 secondary_display->set_bounds( 1110 secondary_display->set_bounds(
1108 gfx::Rect(new_secondary_origin, secondary_bounds.size())); 1111 gfx::Rect(new_secondary_origin, secondary_bounds.size()));
1109 secondary_display->UpdateWorkAreaFromInsets(insets); 1112 secondary_display->UpdateWorkAreaFromInsets(insets);
1110 } 1113 }
1111 1114
1112 } // namespace internal 1115 } // namespace internal
1113 } // namespace ash 1116 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698