Chromium Code Reviews| 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 "chromeos/display/output_configurator.h" | 5 #include "chromeos/display/output_configurator.h" |
| 6 | 6 |
| 7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
| 8 #include <X11/extensions/dpms.h> | 8 #include <X11/extensions/dpms.h> |
| 9 #include <X11/extensions/Xrandr.h> | 9 #include <X11/extensions/Xrandr.h> |
| 10 | 10 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 368 state = STATE_HEADLESS; | 368 state = STATE_HEADLESS; |
| 369 break; | 369 break; |
| 370 case 1: | 370 case 1: |
| 371 state = STATE_SINGLE; | 371 state = STATE_SINGLE; |
| 372 break; | 372 break; |
| 373 case 2: { | 373 case 2: { |
| 374 bool mirror_supported = (0 != outputs[0].mirror_mode) && | 374 bool mirror_supported = (0 != outputs[0].mirror_mode) && |
| 375 (0 != outputs[1].mirror_mode); | 375 (0 != outputs[1].mirror_mode); |
| 376 switch (current_state) { | 376 switch (current_state) { |
| 377 case STATE_DUAL_PRIMARY_ONLY: | 377 case STATE_DUAL_PRIMARY_ONLY: |
| 378 state = | 378 // TODO(oshima): Temporarily disable extended |
| 379 mirror_supported ? STATE_DUAL_MIRROR : STATE_DUAL_PRIMARY_ONLY; | 379 // desktop. crbug.com/152003. |
| 380 state = STATE_DUAL_SECONDARY_ONLY; | |
| 381 break; | |
| 382 case STATE_DUAL_SECONDARY_ONLY: | |
| 383 state = mirror_supported ? | |
| 384 STATE_DUAL_MIRROR : STATE_DUAL_PRIMARY_ONLY; | |
| 380 break; | 385 break; |
| 381 case STATE_DUAL_MIRROR: | 386 case STATE_DUAL_MIRROR: |
| 382 state = STATE_DUAL_PRIMARY_ONLY; | 387 state = STATE_DUAL_PRIMARY_ONLY; |
| 383 break; | 388 break; |
| 384 default: | 389 default: |
| 385 // Unknown so just request something safe. | 390 // Unknown so just request something safe. |
| 386 state = STATE_DUAL_PRIMARY_ONLY; | 391 state = STATE_DUAL_PRIMARY_ONLY; |
| 387 } | 392 } |
| 388 break; | 393 break; |
| 389 } | 394 } |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 827 void OutputConfigurator::AddObserver(Observer* observer) { | 832 void OutputConfigurator::AddObserver(Observer* observer) { |
| 828 observers_.AddObserver(observer); | 833 observers_.AddObserver(observer); |
| 829 } | 834 } |
| 830 | 835 |
| 831 void OutputConfigurator::RemoveObserver(Observer* observer) { | 836 void OutputConfigurator::RemoveObserver(Observer* observer) { |
| 832 observers_.RemoveObserver(observer); | 837 observers_.RemoveObserver(observer); |
| 833 } | 838 } |
| 834 | 839 |
| 835 // static | 840 // static |
| 836 bool OutputConfigurator::IsInternalOutputName(const std::string& name) { | 841 bool OutputConfigurator::IsInternalOutputName(const std::string& name) { |
| 837 return name.find(kInternal_LVDS) == 0 || name.find(kInternal_eDP) == 0; | 842 // TODO(oshima): There is only one display for m23 and no need to |
| 843 // distinguish internal display. | |
| 844 return false; | |
|
Josh Horwich
2012/09/25 00:06:52
Will the fact that we will now always have IsProje
| |
| 838 } | 845 } |
| 839 | 846 |
| 840 void OutputConfigurator::NotifyOnDisplayChanged() { | 847 void OutputConfigurator::NotifyOnDisplayChanged() { |
| 841 notification_timer_.reset(); | 848 notification_timer_.reset(); |
| 842 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayModeChanged()); | 849 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayModeChanged()); |
| 843 } | 850 } |
| 844 | 851 |
| 845 } // namespace chromeos | 852 } // namespace chromeos |
| OLD | NEW |