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 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_KIOSK_INFO_SERVICE_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_KIOSK_INFO_SERVICE_PROVIDER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DBUS_KIOSK_INFO_SERVICE_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DBUS_KIOSK_INFO_SERVICE_PROVIDER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "chromeos/dbus/services/cros_dbus_service.h" | 11 #include "chromeos/dbus/services/cros_dbus_service.h" |
12 #include "dbus/exported_object.h" | 12 #include "dbus/exported_object.h" |
13 | 13 |
14 namespace dbus { | 14 namespace dbus { |
15 class MethodCall; | 15 class MethodCall; |
16 } | 16 } |
17 | 17 |
18 namespace chromeos { | 18 namespace chromeos { |
19 | 19 |
20 // Exports a "GetKioskAppRequiredPlatformVersion" D-Bus method that | 20 // Exports a "GetKioskAppRequiredPlatformVersion" D-Bus method that |
21 // update_engine calls to get the required platform version of the | 21 // update_engine calls to get the required platform version of the |
22 // kiosk app that is configured to auto launch. | 22 // kiosk app that is configured to auto launch. |
23 // See http://crbug.com/577783 for details. | 23 // See http://crbug.com/577783 for details. |
24 // | 24 // |
25 class KioskInfoService : public CrosDBusService::ServiceProviderInterface { | 25 class KioskInfoService : public CrosDBusService::ServiceProviderInterface { |
26 public: | 26 public: |
27 KioskInfoService(); | 27 // TODO(teravest): Remove these extra parameters once this interface is fully |
| 28 // migrated off of LibCrosService. |
| 29 KioskInfoService(const std::string& service_interface, |
| 30 const std::string& method_name); |
28 ~KioskInfoService() override; | 31 ~KioskInfoService() override; |
29 | 32 |
30 // CrosDBusService::ServiceProviderInterface | 33 // CrosDBusService::ServiceProviderInterface |
31 void Start(scoped_refptr<dbus::ExportedObject> exported_object) override; | 34 void Start(scoped_refptr<dbus::ExportedObject> exported_object) override; |
32 | 35 |
33 private: | 36 private: |
34 // Called from ExportedObject when CheckLiveness() is exported as a D-Bus | 37 // Called from ExportedObject when CheckLiveness() is exported as a D-Bus |
35 // method or failed to be exported. | 38 // method or failed to be exported. |
36 void OnExported(const std::string& interface_name, | 39 void OnExported(const std::string& interface_name, |
37 const std::string& method_name, | 40 const std::string& method_name, |
38 bool success); | 41 bool success); |
39 | 42 |
40 // Called on UI thread in response to a D-Bus request. | 43 // Called on UI thread in response to a D-Bus request. |
41 void GetKioskAppRequiredPlatformVersion( | 44 void GetKioskAppRequiredPlatformVersion( |
42 dbus::MethodCall* method_call, | 45 dbus::MethodCall* method_call, |
43 dbus::ExportedObject::ResponseSender response_sender); | 46 dbus::ExportedObject::ResponseSender response_sender); |
44 | 47 |
| 48 std::string service_interface_; |
| 49 std::string method_name_; |
| 50 |
45 base::WeakPtrFactory<KioskInfoService> weak_ptr_factory_; | 51 base::WeakPtrFactory<KioskInfoService> weak_ptr_factory_; |
46 | 52 |
47 DISALLOW_COPY_AND_ASSIGN(KioskInfoService); | 53 DISALLOW_COPY_AND_ASSIGN(KioskInfoService); |
48 }; | 54 }; |
49 | 55 |
50 } // namespace chromeos | 56 } // namespace chromeos |
51 | 57 |
52 #endif // CHROME_BROWSER_CHROMEOS_DBUS_KIOSK_INFO_SERVICE_PROVIDER_H_ | 58 #endif // CHROME_BROWSER_CHROMEOS_DBUS_KIOSK_INFO_SERVICE_PROVIDER_H_ |
OLD | NEW |