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

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

Issue 2802603005: MD Settings: Display: Add unified desktop control and modify api (Closed)
Patch Set: Fix closure and tests Created 3 years, 8 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
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 <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 *error = kKioskOnlyError; 172 *error = kKioskOnlyError;
173 return false; 173 return false;
174 #endif 174 #endif
175 } 175 }
176 176
177 bool SystemDisplayFunction::ShouldRestrictToKioskAndWebUI() { 177 bool SystemDisplayFunction::ShouldRestrictToKioskAndWebUI() {
178 return true; 178 return true;
179 } 179 }
180 180
181 ExtensionFunction::ResponseAction SystemDisplayGetInfoFunction::Run() { 181 ExtensionFunction::ResponseAction SystemDisplayGetInfoFunction::Run() {
182 std::unique_ptr<display::GetInfo::Params> params(
183 display::GetInfo::Params::Create(*args_));
184 bool single_unified = params->flags && params->flags->single_unified &&
185 *params->flags->single_unified;
182 DisplayInfoProvider::DisplayUnitInfoList all_displays_info = 186 DisplayInfoProvider::DisplayUnitInfoList all_displays_info =
183 DisplayInfoProvider::Get()->GetAllDisplaysInfo(); 187 DisplayInfoProvider::Get()->GetAllDisplaysInfo(single_unified);
184 return RespondNow( 188 return RespondNow(
185 ArgumentList(display::GetInfo::Results::Create(all_displays_info))); 189 ArgumentList(display::GetInfo::Results::Create(all_displays_info)));
186 } 190 }
187 191
188 ExtensionFunction::ResponseAction SystemDisplayGetDisplayLayoutFunction::Run() { 192 ExtensionFunction::ResponseAction SystemDisplayGetDisplayLayoutFunction::Run() {
189 DisplayInfoProvider::DisplayLayoutList display_layout = 193 DisplayInfoProvider::DisplayLayoutList display_layout =
190 DisplayInfoProvider::Get()->GetDisplayLayout(); 194 DisplayInfoProvider::Get()->GetDisplayLayout();
191 return RespondNow( 195 return RespondNow(
192 ArgumentList(display::GetDisplayLayout::Results::Create(display_layout))); 196 ArgumentList(display::GetDisplayLayout::Results::Create(display_layout)));
193 } 197 }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 std::string error; 340 std::string error;
337 if (DisplayInfoProvider::Get()->IsNativeTouchCalibrationActive(&error)) 341 if (DisplayInfoProvider::Get()->IsNativeTouchCalibrationActive(&error))
338 return RespondNow(Error(error)); 342 return RespondNow(Error(error));
339 343
340 if (!DisplayInfoProvider::Get()->ClearTouchCalibration(params->id, &error)) 344 if (!DisplayInfoProvider::Get()->ClearTouchCalibration(params->id, &error))
341 return RespondNow(Error(error)); 345 return RespondNow(Error(error));
342 return RespondNow(NoArguments()); 346 return RespondNow(NoArguments());
343 } 347 }
344 348
345 } // namespace extensions 349 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/system_display/display_info_provider.cc ('k') | extensions/common/api/system_display.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698