Upstream version 8.36.169.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / browser / application_service_provider_linux.h
1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef XWALK_APPLICATION_BROWSER_APPLICATION_SERVICE_PROVIDER_LINUX_H_
6 #define XWALK_APPLICATION_BROWSER_APPLICATION_SERVICE_PROVIDER_LINUX_H_
7
8 #include <string>
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11
12 namespace dbus {
13 class Bus;
14 }
15
16 namespace xwalk {
17 namespace application {
18
19 class Application;
20 class ApplicationService;
21 class RunningApplicationObject;
22 class RunningApplicationsManager;
23
24 // Uses a D-Bus service named "org.crosswalkproject.Runtime1" to expose
25 // application management and launch functionality from ApplicationService.
26 class ApplicationServiceProviderLinux {
27  public:
28   ApplicationServiceProviderLinux(ApplicationService* app_service,
29                                   scoped_refptr<dbus::Bus> session_bus);
30   virtual ~ApplicationServiceProviderLinux();
31
32   RunningApplicationObject* GetRunningApplicationObject(const Application* app);
33
34  private:
35   void OnServiceNameExported(const std::string& service_name, bool success);
36
37   // TODO(cmarcelo): Remove this once we expose real objects.
38   void ExportTestObject();
39
40   scoped_refptr<dbus::Bus> session_bus_;
41   scoped_ptr<RunningApplicationsManager> running_apps_;
42 };
43
44 }  // namespace application
45 }  // namespace xwalk
46
47 #endif  // XWALK_APPLICATION_BROWSER_APPLICATION_SERVICE_PROVIDER_LINUX_H_