Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / common / tizen / signature_data.cc
1 // Copyright (c) 2014 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 #include "xwalk/application/common/tizen/signature_data.h"
6
7 #include "base/strings/utf_string_conversions.h"
8
9 namespace xwalk {
10 namespace application {
11
12 SignatureData::SignatureData(const std::string& signature_file_name,
13     int signature_number)
14     : signature_file_name_(signature_file_name),
15       signature_number_(signature_number) {
16 }
17
18 SignatureData::~SignatureData() {
19 }
20
21 base::FilePath SignatureData::GetExtractedWidgetPath() const {
22   std::string widget_path = signature_file_name();
23   size_t pos = widget_path.rfind('/');
24   if (pos == std::string::npos) {
25     widget_path.clear();
26   } else {
27     widget_path.erase(pos + 1, std::string::npos);
28   }
29 #if defined (OS_WIN)
30   return base::FilePath(base::UTF8ToWide(widget_path));
31 #else
32   return base::FilePath(widget_path);
33 #endif
34 }
35
36 }  // namespace application
37 }  // namespace xwalk