OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/system_info_display/system_info_display_
api.h" | 5 #include "chrome/browser/extensions/api/system_info_display/system_info_display_
api.h" |
6 | 6 |
7 namespace extensions { | 7 namespace extensions { |
8 | 8 |
9 using api::system_info_display::DisplayUnitInfo; | 9 using api::system_info_display::DisplayUnitInfo; |
10 | 10 |
11 bool SystemInfoDisplayGetDisplayInfoFunction::RunImpl() { | 11 bool SystemInfoDisplayGetDisplayInfoFunction::RunImpl() { |
12 DisplayInfoProvider::GetDisplayInfo()->StartQueryInfo( | 12 DisplayInfoProvider::GetProvider()->RequestInfo( |
13 base::Bind(&SystemInfoDisplayGetDisplayInfoFunction::OnGetDisplayInfoCompl
eted, | 13 base::Bind( |
14 this)); | 14 &SystemInfoDisplayGetDisplayInfoFunction::OnGetDisplayInfoCompleted, |
| 15 this)); |
15 return true; | 16 return true; |
16 } | 17 } |
17 | 18 |
18 void SystemInfoDisplayGetDisplayInfoFunction::OnGetDisplayInfoCompleted( | 19 void SystemInfoDisplayGetDisplayInfoFunction::OnGetDisplayInfoCompleted( |
19 const DisplayInfo& info, bool success) { | 20 const DisplayInfo& info, bool success) { |
20 if (success) | 21 if (success) |
21 results_ = api::system_info_display::GetDisplayInfo::Results::Create(info); | 22 results_ = api::system_info_display::GetDisplayInfo::Results::Create(info); |
22 else | 23 else |
23 SetError("Error occurred when querying display information."); | 24 SetError("Error occurred when querying display information."); |
24 SendResponse(success); | 25 SendResponse(success); |
25 } | 26 } |
26 | 27 |
27 } // namespace extensions | 28 } // namespace extensions |
OLD | NEW |