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

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: rebase 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
« no previous file with comments | « ash/system/chromeos/tray_display.cc ('k') | chromeos/display/output_configurator.h » ('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 "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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 layout_value.reset(new base::FundamentalValue(layout.position)); 174 layout_value.reset(new base::FundamentalValue(layout.position));
175 offset_value.reset(new base::FundamentalValue(layout.offset)); 175 offset_value.reset(new base::FundamentalValue(layout.offset));
176 } 176 }
177 177
178 web_ui()->CallJavascriptFunction( 178 web_ui()->CallJavascriptFunction(
179 "options.DisplayOptions.setDisplayInfo", 179 "options.DisplayOptions.setDisplayInfo",
180 mirroring, display_info, *layout_value.get(), *offset_value.get()); 180 mirroring, display_info, *layout_value.get(), *offset_value.get());
181 } 181 }
182 182
183 void DisplayOptionsHandler::OnFadeOutForMirroringFinished(bool is_mirroring) { 183 void DisplayOptionsHandler::OnFadeOutForMirroringFinished(bool is_mirroring) {
184 // We use 'PRIMARY_ONLY' for non-mirroring state for now.
185 // TODO(mukai): fix this and support multiple display modes.
186 chromeos::OutputState new_state = 184 chromeos::OutputState new_state =
187 is_mirroring ? STATE_DUAL_MIRROR : STATE_DUAL_PRIMARY_ONLY; 185 is_mirroring ? STATE_DUAL_MIRROR : STATE_DUAL_EXTENDED;
188 ash::Shell::GetInstance()->output_configurator()->SetDisplayMode(new_state); 186 ash::Shell::GetInstance()->output_configurator()->SetDisplayMode(new_state);
189 SendAllDisplayInfo(); 187 SendAllDisplayInfo();
190 // Not necessary to start fade-in animation. OutputConfigurator will do that. 188 // Not necessary to start fade-in animation. OutputConfigurator will do that.
191 } 189 }
192 190
193 void DisplayOptionsHandler::OnFadeOutForDisplayLayoutFinished( 191 void DisplayOptionsHandler::OnFadeOutForDisplayLayoutFinished(
194 int layout, int offset) { 192 int layout, int offset) {
195 const gfx::Display& secondary_display = ash::ScreenAsh::GetSecondaryDisplay(); 193 const gfx::Display& secondary_display = ash::ScreenAsh::GetSecondaryDisplay();
196 if (secondary_display.is_valid()) 194 if (secondary_display.is_valid())
197 SetDisplayLayoutPref(secondary_display, layout, offset); 195 SetDisplayLayoutPref(secondary_display, layout, offset);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 ash::Shell::GetInstance()->output_configurator_animation()-> 248 ash::Shell::GetInstance()->output_configurator_animation()->
251 StartFadeOutAnimation(base::Bind( 249 StartFadeOutAnimation(base::Bind(
252 &DisplayOptionsHandler::OnFadeOutForDisplayLayoutFinished, 250 &DisplayOptionsHandler::OnFadeOutForDisplayLayoutFinished,
253 base::Unretained(this), 251 base::Unretained(this),
254 static_cast<int>(layout), 252 static_cast<int>(layout),
255 static_cast<int>(offset))); 253 static_cast<int>(offset)));
256 } 254 }
257 255
258 } // namespace options 256 } // namespace options
259 } // namespace chromeos 257 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/system/chromeos/tray_display.cc ('k') | chromeos/display/output_configurator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698