Upstream version 8.37.186.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / common / id_util.h
1 // Copyright (c) 2013 The Chromium Authors. 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_COMMON_ID_UTIL_H_
6 #define XWALK_APPLICATION_COMMON_ID_UTIL_H_
7
8 #include <string>
9
10 #include "xwalk/application/common/application_data.h"
11
12 namespace base {
13 class FilePath;
14 }
15
16 namespace xwalk {
17 namespace application {
18 // Generates an application ID from arbitrary input. The same input string will
19 // always generate the same output ID.
20 std::string GenerateId(const std::string& input);
21
22 // Generate an ID for an application in the given path.
23 // Used while developing applications, before they have a key.
24 std::string GenerateIdForPath(const base::FilePath& path);
25
26 // Checks to see if the application has a valid ID.
27 bool IsValidApplicationID(const std::string& id);
28
29 #if defined(OS_TIZEN)
30 std::string GetPackageIdFromAppId(const std::string& app_id);
31 #endif
32
33 }  // namespace application
34 }  // namespace xwalk
35
36 #endif  // XWALK_APPLICATION_COMMON_ID_UTIL_H_