diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-29 01:18:08 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-29 01:18:08 +0000 |
commit | 00afda7fb4262484c521ab2890f376db928854d7 (patch) | |
tree | 775d5b14d338ed627c25f58f3bb3b73d4714e23f /extensions/browser/extension_function.cc | |
parent | ed44abb427a11b618142f05dd9e68cf00d20ab69 (diff) | |
download | chromium_src-00afda7fb4262484c521ab2890f376db928854d7.zip chromium_src-00afda7fb4262484c521ab2890f376db928854d7.tar.gz chromium_src-00afda7fb4262484c521ab2890f376db928854d7.tar.bz2 |
Add ErrorUtils::FormatErrorMessage() syntax to ExtensionFunction::Error().
R=rockot@chromium.org
Review URL: https://codereview.chromium.org/298413003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273430 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/browser/extension_function.cc')
-rw-r--r-- | extensions/browser/extension_function.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/extensions/browser/extension_function.cc b/extensions/browser/extension_function.cc index 3720055..7d092053 100644 --- a/extensions/browser/extension_function.cc +++ b/extensions/browser/extension_function.cc @@ -13,12 +13,14 @@ #include "content/public/browser/web_contents_observer.h" #include "extensions/browser/extension_function_dispatcher.h" #include "extensions/browser/extension_message_filter.h" +#include "extensions/common/error_utils.h" #include "extensions/common/extension_api.h" #include "extensions/common/extension_messages.h" using content::BrowserThread; using content::RenderViewHost; using content::WebContents; +using extensions::ErrorUtils; using extensions::ExtensionAPI; using extensions::Feature; @@ -255,6 +257,30 @@ ExtensionFunction::ResponseValue ExtensionFunction::Error( return ResponseValue(new ErrorResponseValue(this, error)); } +ExtensionFunction::ResponseValue ExtensionFunction::Error( + const std::string& format, + const std::string& s1) { + return ResponseValue( + new ErrorResponseValue(this, ErrorUtils::FormatErrorMessage(format, s1))); +} + +ExtensionFunction::ResponseValue ExtensionFunction::Error( + const std::string& format, + const std::string& s1, + const std::string& s2) { + return ResponseValue(new ErrorResponseValue( + this, ErrorUtils::FormatErrorMessage(format, s1, s2))); +} + +ExtensionFunction::ResponseValue ExtensionFunction::Error( + const std::string& format, + const std::string& s1, + const std::string& s2, + const std::string& s3) { + return ResponseValue(new ErrorResponseValue( + this, ErrorUtils::FormatErrorMessage(format, s1, s2, s3))); +} + ExtensionFunction::ResponseValue ExtensionFunction::BadMessage() { return ResponseValue(new BadMessageResponseValue(this)); } |