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

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
« no previous file with comments | « chrome/browser/ui/webui/options2/chromeos/display_options_handler.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..567ec2efe48c543b390c34310bcd0fa1270868f1 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,8 +176,10 @@ 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";
+ SendDisplayInfo();
return;
}
DCHECK_LE(DisplayController::TOP, layout);
@@ -182,7 +188,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
« no previous file with comments | « chrome/browser/ui/webui/options2/chromeos/display_options_handler.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698