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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/display_options_handler.cc

Issue 12254041: Reconfigure displays even if the output count didn't change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 "chrome/browser/ui/webui/options/chromeos/display_options_handler.h" 5 #include "chrome/browser/ui/webui/options/chromeos/display_options_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/display/display_controller.h" 9 #include "ash/display/display_controller.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 layout_value.reset(new base::FundamentalValue(layout.position)); 173 layout_value.reset(new base::FundamentalValue(layout.position));
174 offset_value.reset(new base::FundamentalValue(layout.offset)); 174 offset_value.reset(new base::FundamentalValue(layout.offset));
175 } 175 }
176 176
177 web_ui()->CallJavascriptFunction( 177 web_ui()->CallJavascriptFunction(
178 "options.DisplayOptions.setDisplayInfo", 178 "options.DisplayOptions.setDisplayInfo",
179 mirroring, display_info, *layout_value.get(), *offset_value.get()); 179 mirroring, display_info, *layout_value.get(), *offset_value.get());
180 } 180 }
181 181
182 void DisplayOptionsHandler::OnFadeOutForMirroringFinished(bool is_mirroring) { 182 void DisplayOptionsHandler::OnFadeOutForMirroringFinished(bool is_mirroring) {
183 // We use 'PRIMARY_ONLY' for non-mirroring state for now. 183 // We use 'PRIMARY_ONLY' for non-mirroring state for now.
sabercrombie 2013/02/16 00:01:08 Looks like this comment should be removed.
oshima 2013/02/16 01:32:52 Done.
184 // TODO(mukai): fix this and support multiple display modes. 184 // TODO(mukai): fix this and support multiple display modes.
185 chromeos::OutputState new_state = 185 chromeos::OutputState new_state =
186 is_mirroring ? STATE_DUAL_MIRROR : STATE_DUAL_PRIMARY_ONLY; 186 is_mirroring ? STATE_DUAL_MIRROR : STATE_DUAL_EXTENDED;
187 ash::Shell::GetInstance()->output_configurator()->SetDisplayMode(new_state); 187 ash::Shell::GetInstance()->output_configurator()->SetDisplayMode(new_state);
188 SendAllDisplayInfo(); 188 SendAllDisplayInfo();
189 // Not necessary to start fade-in animation. OutputConfigurator will do that. 189 // Not necessary to start fade-in animation. OutputConfigurator will do that.
190 } 190 }
191 191
192 void DisplayOptionsHandler::OnFadeOutForDisplayLayoutFinished( 192 void DisplayOptionsHandler::OnFadeOutForDisplayLayoutFinished(
193 int layout, int offset) { 193 int layout, int offset) {
194 const gfx::Display& secondary_display = ash::ScreenAsh::GetSecondaryDisplay(); 194 const gfx::Display& secondary_display = ash::ScreenAsh::GetSecondaryDisplay();
195 if (secondary_display.is_valid()) 195 if (secondary_display.is_valid())
196 SetDisplayLayoutPref(secondary_display, layout, offset); 196 SetDisplayLayoutPref(secondary_display, layout, offset);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 ash::Shell::GetInstance()->output_configurator_animation()-> 249 ash::Shell::GetInstance()->output_configurator_animation()->
250 StartFadeOutAnimation(base::Bind( 250 StartFadeOutAnimation(base::Bind(
251 &DisplayOptionsHandler::OnFadeOutForDisplayLayoutFinished, 251 &DisplayOptionsHandler::OnFadeOutForDisplayLayoutFinished,
252 base::Unretained(this), 252 base::Unretained(this),
253 static_cast<int>(layout), 253 static_cast<int>(layout),
254 static_cast<int>(offset))); 254 static_cast<int>(offset)));
255 } 255 }
256 256
257 } // namespace options 257 } // namespace options
258 } // namespace chromeos 258 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698