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

Side by Side Diff: chrome/browser/chromeos/dbus/kiosk_info_service_provider.cc

Issue 2799963004: Revert of Create org.chromium.KioskAppService. (Closed)
Patch Set: 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
« no previous file with comments | « chrome/browser/chromeos/dbus/kiosk_info_service_provider.h ('k') | chromeos/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/logging.h" 11 #include "base/logging.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(const std::string& service_interface, 18 KioskInfoService::KioskInfoService() : weak_ptr_factory_(this) {}
19 const std::string& method_name)
20 : service_interface_(service_interface),
21 method_name_(method_name),
22 weak_ptr_factory_(this) {}
23 19
24 KioskInfoService::~KioskInfoService() {} 20 KioskInfoService::~KioskInfoService() {}
25 21
26 void KioskInfoService::Start( 22 void KioskInfoService::Start(
27 scoped_refptr<dbus::ExportedObject> exported_object) { 23 scoped_refptr<dbus::ExportedObject> exported_object) {
28 exported_object->ExportMethod( 24 exported_object->ExportMethod(
29 service_interface_, method_name_, 25 kLibCrosServiceInterface, kGetKioskAppRequiredPlatforVersion,
30 base::Bind(&KioskInfoService::GetKioskAppRequiredPlatformVersion, 26 base::Bind(&KioskInfoService::GetKioskAppRequiredPlatformVersion,
31 weak_ptr_factory_.GetWeakPtr()), 27 weak_ptr_factory_.GetWeakPtr()),
32 base::Bind(&KioskInfoService::OnExported, 28 base::Bind(&KioskInfoService::OnExported,
33 weak_ptr_factory_.GetWeakPtr())); 29 weak_ptr_factory_.GetWeakPtr()));
34 } 30 }
35 31
36 void KioskInfoService::OnExported(const std::string& interface_name, 32 void KioskInfoService::OnExported(const std::string& interface_name,
37 const std::string& method_name, 33 const std::string& method_name,
38 bool success) { 34 bool success) {
39 if (!success) 35 if (!success)
40 LOG(ERROR) << "Failed to export " << interface_name << "." << method_name; 36 LOG(ERROR) << "Failed to export " << interface_name << "." << method_name;
41 } 37 }
42 38
43 void KioskInfoService::GetKioskAppRequiredPlatformVersion( 39 void KioskInfoService::GetKioskAppRequiredPlatformVersion(
44 dbus::MethodCall* method_call, 40 dbus::MethodCall* method_call,
45 dbus::ExportedObject::ResponseSender response_sender) { 41 dbus::ExportedObject::ResponseSender response_sender) {
46 std::unique_ptr<dbus::Response> response = 42 std::unique_ptr<dbus::Response> response =
47 dbus::Response::FromMethodCall(method_call); 43 dbus::Response::FromMethodCall(method_call);
48 dbus::MessageWriter writer(response.get()); 44 dbus::MessageWriter writer(response.get());
49 writer.AppendString( 45 writer.AppendString(
50 KioskAppManager::Get()->GetAutoLaunchAppRequiredPlatformVersion()); 46 KioskAppManager::Get()->GetAutoLaunchAppRequiredPlatformVersion());
51 response_sender.Run(std::move(response)); 47 response_sender.Run(std::move(response));
52 } 48 }
53 49
54 } // namespace chromeos 50 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/dbus/kiosk_info_service_provider.h ('k') | chromeos/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698