2 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
15 #include "common/version_info.h"
18 #include "system_info.h"
19 #include "system_info_internal.h"
22 #include "common/version_info_efl.h"
24 namespace EflWebView {
26 const char kOSTypeLinux[] = "Linux";
28 VersionInfo* VersionInfo::version_info_ = NULL;
30 VersionInfo* VersionInfo::GetInstance() {
32 version_info_ = new VersionInfo;
36 void VersionInfo::DeleteInstance() {
42 VersionInfo::VersionInfo()
43 : product_name_(PRODUCT_NAME),
44 product_version_(PRODUCT_VERSION) {
47 void VersionInfo::SetProductName(const std::string& name) {
51 std::string VersionInfo::LastChange() const {
55 bool VersionInfo::IsOfficialBuild() const {
56 return IS_OFFICIAL_BUILD;
59 std::string VersionInfo::CreateVersionString() const {
60 std::string current_version;
62 current_version += Version();
63 current_version += " (";
64 current_version += " ";
65 current_version += LastChange();
66 current_version += " ";
67 current_version += OSType();
68 current_version += ")";
70 return current_version;
73 std::string VersionInfo::OSType() const {
75 char *device_model = NULL;
76 char *tizen_version = NULL;
77 char *platform_name = NULL;
78 std::string device_model_str;
79 std::string tizen_version_str;
80 std::string platform_name_str;
81 int result = system_info_get_value_string(SYSTEM_INFO_KEY_TIZEN_VERSION, &tizen_version);
82 if (result == SYSTEM_INFO_ERROR_NONE) {
83 tizen_version_str.assign(tizen_version);
86 result = system_info_get_value_string(SYSTEM_INFO_KEY_PLATFORM_NAME, &platform_name);
87 if (result == SYSTEM_INFO_ERROR_NONE) {
88 platform_name_str.assign(platform_name);
91 result = system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &device_model);
92 if (result == SYSTEM_INFO_ERROR_NONE) {
93 device_model_str.assign(device_model);
108 std::string VersionInfo::ProductNameAndVersionForUserAgent() const {
110 return std::string();
112 // max koo : Some WebRTC web-sites needs the Chrome version number to check
113 // if the browser supports the WebRTC feature.
114 // Currently Chumium also use the hard-code for the Chrome version number.
115 // See http://crbug.com/297522
116 // Does we need to open our real version number?
117 // or just use 33.0.0.0 as Chromium does.
118 return std::string("Chrome/34.0.1847.76 ") +
124 } //namespace EflWebView