Index: chrome/renderer/extensions/chrome_v8_extension.cc |
diff --git a/chrome/renderer/extensions/chrome_v8_extension.cc b/chrome/renderer/extensions/chrome_v8_extension.cc |
index 791b1f533c9a7b35e5d9c6615db39e4d86628f73..486d68be8392a192eae791ed3ce4318419bb0122 100644 |
--- a/chrome/renderer/extensions/chrome_v8_extension.cc |
+++ b/chrome/renderer/extensions/chrome_v8_extension.cc |
@@ -77,41 +77,3 @@ const Extension* ChromeV8Extension::GetExtensionForCurrentRenderView() const { |
return extensions->GetExtensionOrAppByURL( |
ExtensionURLInfo(document.securityOrigin(), url)); |
} |
- |
-bool ChromeV8Extension::CheckCurrentContextAccessToExtensionAPI( |
- const std::string& function_name) const { |
- ChromeV8Context* context = |
- extension_dispatcher_->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 = |
- extension_dispatcher_->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 (!extension_dispatcher_->IsExtensionActive(extension->id()) && |
- ExtensionAPI::GetInstance()->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; |
-} |