Index: chrome/renderer/extensions/extension_dispatcher.cc |
diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc |
index eb320fd021df880174cd607fab0c5efeac29b9ea..e69328a29723180ad3d5ed4f50ba5691b500faa3 100644 |
--- a/chrome/renderer/extensions/extension_dispatcher.cc |
+++ b/chrome/renderer/extensions/extension_dispatcher.cc |
@@ -876,39 +876,3 @@ void ExtensionDispatcher::OnExtensionResponse(int request_id, |
const std::string& error) { |
request_sender_->HandleResponse(request_id, success, response, error); |
} |
- |
-bool ExtensionDispatcher::CheckCurrentContextAccessToExtensionAPI( |
- const std::string& function_name) const { |
- ChromeV8Context* context = v8_context_set().GetCurrent(); |
- if (!context) { |
- DLOG(ERROR) << "Not in a v8::Context"; |
- return false; |
- } |
- |
- const ::Extension* extension = NULL; |
- if (!context->extension_id().empty()) { |
- extension = extensions()->GetByID(context->extension_id()); |
- } |
- |
- if (!extension || !extension->HasAPIPermission(function_name)) { |
- static const char kMessage[] = |
- "You do not have permission to use '%s'. Be sure to declare" |
- " in your manifest what permissions you need."; |
- std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
- v8::ThrowException( |
- v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
- return false; |
- } |
- |
- if (!IsExtensionActive(extension->id()) && |
- ExtensionAPI::GetSharedInstance()->IsPrivileged(function_name)) { |
- static const char kMessage[] = |
- "%s can only be used in an extension process."; |
- std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
- v8::ThrowException( |
- v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
- return false; |
- } |
- |
- return true; |
-} |