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

Unified Diff: chrome/browser/ui/webui/options2/chromeos/display_options_handler.cc

Issue 10836046: Allow offset for secondary display position in chrome://settings/display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
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 c106dfc88db60e4a0f25112dca8b50af02e65d21..3c6040573153dba76ae1a435b0289ab560998fff 100644
--- a/chrome/browser/ui/webui/options2/chromeos/display_options_handler.cc
+++ b/chrome/browser/ui/webui/options2/chromeos/display_options_handler.cc
@@ -120,10 +120,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) {
@@ -136,9 +138,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();
@@ -162,7 +166,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;
}
@@ -172,7 +177,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

Powered by Google App Engine
This is Rietveld 408576698