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

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

Issue 1866103002: [Extensions] Expand bindings access checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 4 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 | « no previous file | chrome/renderer/extensions/tabs_custom_bindings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
diff --git a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
index 91725af9e439a1c7c4b7658cc36f05ffbe9d0dcd..c56394921b28746f38e96b9896df22072f709fef 100644
--- a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
+++ b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
@@ -39,6 +39,8 @@
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/switches.h"
#include "extensions/renderer/dispatcher.h"
+#include "extensions/renderer/i18n_custom_bindings.h"
+#include "extensions/renderer/lazy_background_page_native_handler.h"
#include "extensions/renderer/native_handler.h"
#include "extensions/renderer/resource_bundle_source_map.h"
#include "extensions/renderer/script_context.h"
@@ -124,6 +126,19 @@ void ChromeExtensionsDispatcherDelegate::RegisterNativeHandlers(
"automationInternal",
std::unique_ptr<NativeHandler>(
new extensions::AutomationInternalCustomBindings(context)));
+
+ // The following are native handlers that are defined in //extensions, but
+ // are only used for APIs defined in Chrome.
+ // TODO(devlin): We should clean this up. If an API is defined in Chrome,
+ // there's no reason to have its native handlers residing and being compiled
+ // in //extensions.
+ module_system->RegisterNativeHandler(
+ "i18n",
+ scoped_ptr<NativeHandler>(new extensions::I18NCustomBindings(context)));
+ module_system->RegisterNativeHandler(
+ "lazy_background_page",
+ scoped_ptr<NativeHandler>(
+ new extensions::LazyBackgroundPageNativeHandler(context)));
}
void ChromeExtensionsDispatcherDelegate::PopulateSourceMap(
« no previous file with comments | « no previous file | chrome/renderer/extensions/tabs_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698