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

Unified Diff: chrome/renderer/extensions/api_definitions_natives.cc

Issue 10024055: Remove unneeded extension_messages_browsertest.cc + cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: windoooowze Created 8 years, 8 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 | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/extensions/app_bindings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/api_definitions_natives.cc
diff --git a/chrome/renderer/extensions/api_definitions_natives.cc b/chrome/renderer/extensions/api_definitions_natives.cc
index 37621acda6a25193cf5156c401d6af66e482c4f8..bc8b4b0f9ea0a3642a8358184f5732628f505ab9 100644
--- a/chrome/renderer/extensions/api_definitions_natives.cc
+++ b/chrome/renderer/extensions/api_definitions_natives.cc
@@ -4,9 +4,6 @@
#include "chrome/renderer/extensions/api_definitions_natives.h"
-#include "chrome/common/extensions/api/extension_api.h"
-#include "chrome/renderer/extensions/user_script_slave.h"
-
namespace extensions {
ApiDefinitionsNatives::ApiDefinitionsNatives(
@@ -22,28 +19,8 @@ v8::Handle<v8::Value> ApiDefinitionsNatives::GetExtensionAPIDefinition(
ChromeV8Context* v8_context =
extension_dispatcher()->v8_context_set().GetCurrent();
CHECK(v8_context);
-
- // TODO(kalman): This is being calculated twice, first in
- // ExtensionDispatcher then again here. It might as well be a property of
- // ChromeV8Context, however, this would require making ChromeV8Context take
- // an Extension rather than an extension ID. In itself this is fine,
- // however it does not play correctly with the "IsTestExtensionId" checks.
- // We need to remove that first.
- scoped_ptr<std::set<std::string> > apis;
-
- const std::string& extension_id = v8_context->extension_id();
- if (extension_dispatcher()->IsTestExtensionId(extension_id)) {
- apis.reset(new std::set<std::string>());
- // The minimal set of APIs that tests need.
- apis->insert("extension");
- } else {
- apis = ExtensionAPI::GetSharedInstance()->GetAPIsForContext(
- v8_context->context_type(),
- extension_dispatcher()->extensions()->GetByID(extension_id),
- UserScriptSlave::GetDataSourceURLForFrame(v8_context->web_frame()));
- }
-
- return extension_dispatcher()->v8_schema_registry()->GetSchemas(*apis);
+ return extension_dispatcher()->v8_schema_registry()->GetSchemas(
+ v8_context->GetAvailableExtensionAPIs());
}
} // namespace extensions
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/extensions/app_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698