Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: extensions/browser/extension_function.cc

Issue 298413003: Add ErrorUtils::FormatErrorMessage() syntax to ExtensionFunction::Error(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: namespace Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/extension_function.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_function.cc
diff --git a/extensions/browser/extension_function.cc b/extensions/browser/extension_function.cc
index 372005571e4d4e372a045ac900adcf18fab5b06c..7d0920534ec7a920258815bf3ceda1b90038d943 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));
}
« no previous file with comments | « extensions/browser/extension_function.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698