Upstream version 8.36.161.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / browser / linux / installed_application_object.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_LINUX_INSTALLED_APPLICATION_OBJECT_H_
6 #define XWALK_APPLICATION_BROWSER_LINUX_INSTALLED_APPLICATION_OBJECT_H_
7
8 #include <string>
9 #include "base/memory/ref_counted.h"
10 #include "xwalk/dbus/object_manager_adaptor.h"
11
12 namespace xwalk {
13 namespace application {
14
15 class ApplicationData;
16
17 extern const char kInstalledApplicationDBusInterface[];
18 extern const char kInstalledApplicationDBusError[];
19
20 // Holds the D-Bus representation of an installed application. These objects are
21 // owned by InstalledApplicationsManager and the corresponding objects in D-Bus
22 // are child of '/installed/' object path.
23 class InstalledApplicationObject : public dbus::ManagedObject {
24  public:
25   InstalledApplicationObject(
26       scoped_refptr<dbus::Bus> bus, const dbus::ObjectPath& path,
27       const ApplicationData* app);
28
29   void OnApplicationNameChanged(const std::string& app_name);
30   // Set the callback used when the Uninstall() method is called in an
31   // ApplicationObject.
32   void ExportUninstallMethod(
33       dbus::ExportedObject::MethodCallCallback method_call_callback,
34       dbus::ExportedObject::OnExportedCallback on_exported_callback);
35
36   std::string app_id() const { return app_id_; }
37
38  private:
39   std::string app_id_;
40 };
41
42 }  // namespace application
43 }  // namespace xwalk
44
45 #endif  // XWALK_APPLICATION_BROWSER_LINUX_INSTALLED_APPLICATION_OBJECT_H_