OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chromeos/dbus/kiosk_info_service_provider.h" | 5 #include "chrome/browser/chromeos/dbus/kiosk_info_service_provider.h" |
6 | 6 |
| 7 #include <memory> |
7 #include <utility> | 8 #include <utility> |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 12 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
13 #include "dbus/message.h" | 13 #include "dbus/message.h" |
14 #include "third_party/cros_system_api/dbus/service_constants.h" | 14 #include "third_party/cros_system_api/dbus/service_constants.h" |
15 | 15 |
16 namespace chromeos { | 16 namespace chromeos { |
17 | 17 |
18 KioskInfoService::KioskInfoService() : weak_ptr_factory_(this) {} | 18 KioskInfoService::KioskInfoService() : weak_ptr_factory_(this) {} |
19 | 19 |
20 KioskInfoService::~KioskInfoService() {} | 20 KioskInfoService::~KioskInfoService() {} |
21 | 21 |
(...skipping 10 matching lines...) Expand all Loading... |
32 void KioskInfoService::OnExported(const std::string& interface_name, | 32 void KioskInfoService::OnExported(const std::string& interface_name, |
33 const std::string& method_name, | 33 const std::string& method_name, |
34 bool success) { | 34 bool success) { |
35 if (!success) | 35 if (!success) |
36 LOG(ERROR) << "Failed to export " << interface_name << "." << method_name; | 36 LOG(ERROR) << "Failed to export " << interface_name << "." << method_name; |
37 } | 37 } |
38 | 38 |
39 void KioskInfoService::GetKioskAppRequiredPlatformVersion( | 39 void KioskInfoService::GetKioskAppRequiredPlatformVersion( |
40 dbus::MethodCall* method_call, | 40 dbus::MethodCall* method_call, |
41 dbus::ExportedObject::ResponseSender response_sender) { | 41 dbus::ExportedObject::ResponseSender response_sender) { |
42 scoped_ptr<dbus::Response> response = | 42 std::unique_ptr<dbus::Response> response = |
43 dbus::Response::FromMethodCall(method_call); | 43 dbus::Response::FromMethodCall(method_call); |
44 dbus::MessageWriter writer(response.get()); | 44 dbus::MessageWriter writer(response.get()); |
45 writer.AppendString( | 45 writer.AppendString( |
46 KioskAppManager::Get()->GetAutoLaunchAppRequiredPlatformVersion()); | 46 KioskAppManager::Get()->GetAutoLaunchAppRequiredPlatformVersion()); |
47 response_sender.Run(std::move(response)); | 47 response_sender.Run(std::move(response)); |
48 } | 48 } |
49 | 49 |
50 } // namespace chromeos | 50 } // namespace chromeos |
OLD | NEW |