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

Unified Diff: chrome/renderer/resources/extensions/browser_action_custom_bindings.js

Issue 2959583002: [Extensions Bindings] Don't load lastError module with native bindings (Closed)
Patch Set: rebase Created 3 years, 5 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 | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/browser_action_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/browser_action_custom_bindings.js b/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
index 4b6ce09a74e906312cce7af990c0b9f869b0b908..e844f734567457a18715353a9f94768d986364be 100644
--- a/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
@@ -11,7 +11,12 @@ var getExtensionViews = requireNative('runtime').GetExtensionViews;
var sendRequest = bindingUtil ?
$Function.bind(bindingUtil.sendRequest, bindingUtil) :
require('sendRequest').sendRequest;
-var lastError = require('lastError');
+
+var jsLastError = bindingUtil ? undefined : require('lastError');
+function hasLastError() {
+ return bindingUtil ?
+ bindingUtil.hasLastError() : jsLastError.hasError(chrome);
+}
binding.registerCustomHook(function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
@@ -30,7 +35,7 @@ binding.registerCustomHook(function(bindingsAPI) {
if (!callback)
return;
- if (lastError.hasError(chrome)) {
+ if (hasLastError()) {
callback();
} else {
var views = getExtensionViews(-1, -1, 'POPUP');
« no previous file with comments | « no previous file | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698