Commit fb792f3b authored by rkc@chromium.org's avatar rkc@chromium.org

Start in extended desktop mode if it is enabled.

Currently we start in mirrored mode by default every time; change this so that if the extended desktop is enabled, we default to that instead.

R=sky@chromium.org
BUG=138093


Review URL: https://chromiumcodereview.appspot.com/10836037

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149342 0039d316-1c4b-4281-b951-d872f2087c98
parent bc62b5a5
......@@ -407,8 +407,7 @@ bool AcceleratorController::PerformAction(int action,
case TOGGLE_SPOKEN_FEEDBACK:
return HandleToggleSpokenFeedback();
case CYCLE_DISPLAY_MODE:
ash::Shell::GetInstance()->output_configurator()->CycleDisplayMode(
internal::DisplayController::IsExtendedDesktopEnabled());
ash::Shell::GetInstance()->output_configurator()->CycleDisplayMode();
return true;
#endif
case OPEN_FEEDBACK_PAGE:
......
......@@ -180,7 +180,8 @@ Shell::Shell(ShellDelegate* delegate)
env_filter_(NULL),
delegate_(delegate),
#if defined(OS_CHROMEOS)
output_configurator_(new chromeos::OutputConfigurator()),
output_configurator_(new chromeos::OutputConfigurator(
internal::DisplayController::IsExtendedDesktopEnabled())),
#endif // defined(OS_CHROMEOS)
shelf_(NULL),
panel_layout_manager_(NULL),
......
......@@ -222,8 +222,9 @@ static float ComputeDeviceScaleFactor(unsigned int width,
} // namespace
OutputConfigurator::OutputConfigurator()
OutputConfigurator::OutputConfigurator(bool is_extended_display_enabled)
: is_running_on_chrome_os_(base::chromeos::IsRunningOnChromeOS()),
is_extended_display_enabled_(is_extended_display_enabled),
output_count_(0),
output_cache_(NULL),
mirror_supported_(false),
......@@ -275,7 +276,7 @@ OutputConfigurator::OutputConfigurator()
OutputConfigurator::~OutputConfigurator() {
}
bool OutputConfigurator::CycleDisplayMode(bool extended_desktop_enabled) {
bool OutputConfigurator::CycleDisplayMode() {
VLOG(1) << "CycleDisplayMode";
if (!is_running_on_chrome_os_)
return false;
......@@ -294,7 +295,7 @@ bool OutputConfigurator::CycleDisplayMode(bool extended_desktop_enabled) {
new_state = STATE_DUAL_PRIMARY_ONLY;
break;
case STATE_DUAL_PRIMARY_ONLY:
if (extended_desktop_enabled) {
if (is_extended_display_enabled_) {
if (mirror_supported_)
new_state = STATE_DUAL_MIRROR;
else
......@@ -721,11 +722,15 @@ bool OutputConfigurator::RecacheAndUseDefaultState() {
OutputState OutputConfigurator::GetDefaultState() const {
OutputState state = STATE_HEADLESS;
if (-1 != primary_output_index_) {
if (-1 != secondary_output_index_)
state = mirror_supported_ ? STATE_DUAL_MIRROR : STATE_DUAL_PRIMARY_ONLY;
if (-1 != secondary_output_index_) {
if (is_extended_display_enabled_ || !mirror_supported_)
state = STATE_DUAL_PRIMARY_ONLY;
else
state = STATE_DUAL_MIRROR;
} else {
state = STATE_SINGLE;
}
}
return state;
}
......
......@@ -40,7 +40,7 @@ enum OutputState {
// it.
class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
public:
OutputConfigurator();
explicit OutputConfigurator(bool is_extended_display_enabled);
virtual ~OutputConfigurator();
OutputState output_state() const { return output_state_; }
......@@ -48,7 +48,7 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
// Called when the user hits ctrl-F4 to request a display mode change.
// This method should only return false if it was called in a single-head or
// headless mode.
bool CycleDisplayMode(bool extended_desktop_enabled);
bool CycleDisplayMode();
// Called when powerd notifies us that some set of displays should be turned
// on or off. This requires enabling or disabling the CRTC associated with
......@@ -131,6 +131,9 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
// configuration to immediately fail without changing the state.
bool is_running_on_chrome_os_;
// Set to true if the extended display flag is enabled.
const bool is_extended_display_enabled_;
// The number of outputs in the output_cache_ array.
int output_count_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment