Upstream version 9.37.195.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / common / installer / 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/installer/signature_data.h"
6
7 namespace xwalk {
8 namespace application {
9
10 SignatureData::SignatureData(const std::string& signature_file_name,
11     int signature_number)
12     : signature_file_name_(signature_file_name),
13       signature_number_(signature_number) {
14 }
15
16 SignatureData::~SignatureData() {
17 }
18
19 base::FilePath SignatureData::GetExtractedWidgetPath() const {
20   std::string widget_path = signature_file_name();
21   size_t pos = widget_path.rfind('/');
22   if (pos == std::string::npos) {
23     widget_path.clear();
24   } else {
25     widget_path.erase(pos + 1, std::string::npos);
26   }
27   return base::FilePath(widget_path);
28 }
29
30 }  // namespace application
31 }  // namespace xwalk