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

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

Issue 15091002: Lazily load API schemas from resource files and convert all APIs to features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos tests Created 7 years, 6 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/extensions/event_unittest.cc ('k') | chrome/renderer/extensions/v8_schema_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/runtime_custom_bindings.cc
diff --git a/chrome/renderer/extensions/runtime_custom_bindings.cc b/chrome/renderer/extensions/runtime_custom_bindings.cc
index 587fcb738069487b719ee9ea1d3f47289938f17e..f649c73d02bb3abede7bcd8bbeff13b678a6762e 100644
--- a/chrome/renderer/extensions/runtime_custom_bindings.cc
+++ b/chrome/renderer/extensions/runtime_custom_bindings.cc
@@ -9,6 +9,7 @@
#include "base/values.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_messages.h"
+#include "chrome/common/extensions/features/base_feature_provider.h"
#include "chrome/common/extensions/manifest.h"
#include "chrome/renderer/extensions/chrome_v8_context.h"
#include "chrome/renderer/extensions/dispatcher.h"
@@ -64,8 +65,11 @@ v8::Handle<v8::Value> RuntimeCustomBindings::OpenChannelToExtension(
v8::Handle<v8::Value> RuntimeCustomBindings::OpenChannelToNativeApp(
const v8::Arguments& args) {
// Verify that the extension has permission to use native messaging.
- if (!dispatcher()->CheckContextAccessToExtensionAPI(
- "nativeMessaging", context())) {
+ if (!BaseFeatureProvider::GetByName("permission")->GetFeature(
+ "nativeMessaging")->IsAvailableToContext(
+ GetExtensionForRenderView(),
+ context()->context_type(),
+ context()->GetURL()).is_available()) {
return v8::Undefined();
}
« no previous file with comments | « chrome/renderer/extensions/event_unittest.cc ('k') | chrome/renderer/extensions/v8_schema_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698