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

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

Issue 14494013: Allow API functions and events to have entries in _api_features.json (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix browser_tests, Stubs now inspects _api_features.json Created 7 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
Index: chrome/renderer/extensions/chrome_v8_context.cc
diff --git a/chrome/renderer/extensions/chrome_v8_context.cc b/chrome/renderer/extensions/chrome_v8_context.cc
index 61f2c2dc1a69cdaa8aafc6c267a2f91aa7e9b471..47171c8cecb9e4bb88f996f4023928a5d876c67f 100644
--- a/chrome/renderer/extensions/chrome_v8_context.cc
+++ b/chrome/renderer/extensions/chrome_v8_context.cc
@@ -12,6 +12,7 @@
#include "chrome/common/extensions/api/extension_api.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_set.h"
+#include "chrome/common/extensions/features/base_feature_provider.h"
#include "chrome/renderer/extensions/chrome_v8_extension.h"
#include "chrome/renderer/extensions/module_system.h"
#include "chrome/renderer/extensions/user_script_slave.h"
@@ -152,22 +153,19 @@ bool ChromeV8Context::CallChromeHiddenMethod(
return true;
}
-Feature::Availability ChromeV8Context::GetAvailability(
+bool ChromeV8Context::IsAnyFeatureAvailableToContext(
const std::string& api_name) {
- return GetAvailabilityInternal(api_name, extension_);
+ return ExtensionAPI::GetSharedInstance()->IsAnyFeatureAvailableToContext(
+ api_name,
+ context_type_,
+ UserScriptSlave::GetDataSourceURLForFrame(web_frame_));
}
-Feature::Availability ChromeV8Context::GetAvailabilityForContext(
+Feature::Availability ChromeV8Context::GetAvailability(
const std::string& api_name) {
- return GetAvailabilityInternal(api_name, NULL);
-}
-
-Feature::Availability ChromeV8Context::GetAvailabilityInternal(
- const std::string& api_name,
- const Extension* extension) {
return ExtensionAPI::GetSharedInstance()->IsAvailable(
api_name,
- extension,
+ extension_,
context_type_,
UserScriptSlave::GetDataSourceURLForFrame(web_frame_));
}

Powered by Google App Engine
This is Rietveld 408576698