Chromium Code Reviews| Index: chrome/browser/ui/webui/options2/chromeos/display_options_handler.cc |
| diff --git a/chrome/browser/ui/webui/options2/chromeos/display_options_handler.cc b/chrome/browser/ui/webui/options2/chromeos/display_options_handler.cc |
| index 1607f70499c22aaade5dace557ac460d2e476680..3bb9067706478f122695715f3590f757a64dc983 100644 |
| --- a/chrome/browser/ui/webui/options2/chromeos/display_options_handler.cc |
| +++ b/chrome/browser/ui/webui/options2/chromeos/display_options_handler.cc |
| @@ -130,10 +130,12 @@ void DisplayOptionsHandler::SendDisplayInfo() { |
| PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| base::FundamentalValue layout( |
| pref_service->GetInteger(prefs::kSecondaryDisplayLayout)); |
| + base::FundamentalValue offset( |
| + pref_service->GetInteger(prefs::kSecondaryDisplayOffset)); |
| web_ui()->CallJavascriptFunction( |
| "options.DisplayOptions.setDisplayInfo", |
| - mirroring, displays, layout); |
| + mirroring, displays, layout, offset); |
| } |
| void DisplayOptionsHandler::FadeOutForMirroringFinished(bool is_mirroring) { |
| @@ -146,9 +148,11 @@ void DisplayOptionsHandler::FadeOutForMirroringFinished(bool is_mirroring) { |
| // Not necessary to start fade-in animation. OutputConfigurator will do that. |
| } |
| -void DisplayOptionsHandler::FadeOutForDisplayLayoutFinished(int layout) { |
| +void DisplayOptionsHandler::FadeOutForDisplayLayoutFinished( |
| + int layout, int offset) { |
| PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| pref_service->SetInteger(prefs::kSecondaryDisplayLayout, layout); |
| + pref_service->SetInteger(prefs::kSecondaryDisplayOffset, offset); |
| SendDisplayInfo(); |
| ash::Shell::GetInstance()->output_configurator_animation()-> |
| StartFadeInAnimation(); |
| @@ -172,7 +176,8 @@ void DisplayOptionsHandler::HandleMirroring(const base::ListValue* args) { |
| void DisplayOptionsHandler::HandleDisplayLayout(const base::ListValue* args) { |
| double layout = -1; |
| - if (!args->GetDouble(0, &layout)) { |
| + double offset = -1; |
| + if (!args->GetDouble(0, &layout) || !args->GetDouble(1, &offset)) { |
| LOG(ERROR) << "Invalid parameter"; |
| return; |
|
James Hawkins
2012/08/11 17:37:42
When does this happen?
Jun Mukai
2012/08/13 05:33:25
Good point. Added "SendDisplayInfo" to refresh th
|
| } |
| @@ -182,7 +187,8 @@ void DisplayOptionsHandler::HandleDisplayLayout(const base::ListValue* args) { |
| StartFadeOutAnimation(base::Bind( |
| &DisplayOptionsHandler::FadeOutForDisplayLayoutFinished, |
| base::Unretained(this), |
| - static_cast<int>(layout))); |
| + static_cast<int>(layout), |
| + static_cast<int>(offset))); |
| } |
| } // namespace options2 |