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

Side by Side Diff: extensions/browser/api/system_display/system_display_api.cc

Issue 2538623002: Adds touch calibration methods to system_display.idl API (Closed)
Patch Set: Adds touch calibration methods to system.idl API Created 4 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/api/system_display/system_display_api.h" 5 #include "extensions/browser/api/system_display/system_display_api.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 SystemDisplayOverscanCalibrationCompleteFunction::Run() { 131 SystemDisplayOverscanCalibrationCompleteFunction::Run() {
132 std::unique_ptr<display::OverscanCalibrationComplete::Params> params( 132 std::unique_ptr<display::OverscanCalibrationComplete::Params> params(
133 display::OverscanCalibrationComplete::Params::Create(*args_)); 133 display::OverscanCalibrationComplete::Params::Create(*args_));
134 if (!DisplayInfoProvider::Get()->OverscanCalibrationComplete(params->id)) { 134 if (!DisplayInfoProvider::Get()->OverscanCalibrationComplete(params->id)) {
135 return RespondNow( 135 return RespondNow(
136 Error("Calibration not started for display ID: " + params->id)); 136 Error("Calibration not started for display ID: " + params->id));
137 } 137 }
138 return RespondNow(NoArguments()); 138 return RespondNow(NoArguments());
139 } 139 }
140 140
141 ExtensionFunction::ResponseAction
142 SystemDisplayTouchCalibrationStartFunction::Run() {
143 std::unique_ptr<display::TouchCalibrationStart::Params> params(
144 display::TouchCalibrationStart::Params::Create(*args_));
145 if (!DisplayInfoProvider::Get()->TouchCalibrationStart(params->id))
146 return RespondNow(Error("Invalid display ID: " + params->id));
stevenjb 2016/11/29 18:53:29 nit: It might be nice to explictly check for in-pr
malaykeshav 2016/11/30 00:53:16 Done
147 return RespondNow(NoArguments());
148 }
149
150 ExtensionFunction::ResponseAction
151 SystemDisplayTouchCalibrationSetFunction::Run() {
152 std::unique_ptr<display::TouchCalibrationSet::Params> params(
153 display::TouchCalibrationSet::Params::Create(*args_));
154 if (!DisplayInfoProvider::Get()->TouchCalibrationSet(params->id,
155 params->pairs,
156 params->bounds))
157 return RespondNow(Error("Invalid display ID: " + params->id));
stevenjb 2016/11/29 18:53:29 {}
malaykeshav 2016/11/30 00:53:16 Done
158 return RespondNow(NoArguments());
159 }
160
161 ExtensionFunction::ResponseAction
162 SystemDisplayTouchCalibrationResetFunction::Run() {
163 std::unique_ptr<display::TouchCalibrationReset::Params> params(
164 display::TouchCalibrationReset::Params::Create(*args_));
165 if (!DisplayInfoProvider::Get()->TouchCalibrationReset(params->id))
166 return RespondNow(Error("Invalid display ID: " + params->id));
167 return RespondNow(NoArguments());
168 }
169
141 } // namespace extensions 170 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698