Home | History | Annotate | Download | only in extensions
      1 // Copyright (c) 2009 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 #include "chrome/common/extensions/extension_error_utils.h"
      6 
      7 #include "base/string_util.h"
      8 
      9 std::string ExtensionErrorUtils::FormatErrorMessage(
     10     const std::string& format,
     11     const std::string& s1) {
     12   std::string ret_val = format;
     13   ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1);
     14   return ret_val;
     15 }
     16 
     17 std::string ExtensionErrorUtils::FormatErrorMessage(
     18     const std::string& format,
     19     const std::string& s1,
     20     const std::string& s2) {
     21   std::string ret_val = format;
     22   ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1);
     23   ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2);
     24   return ret_val;
     25 }
     26 
     27 std::string ExtensionErrorUtils::FormatErrorMessage(
     28     const std::string& format,
     29     const std::string& s1,
     30     const std::string& s2,
     31     const std::string& s3) {
     32   std::string ret_val = format;
     33   ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1);
     34   ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2);
     35   ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s3);
     36   return ret_val;
     37 }
     38