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

Unified Diff: chrome/browser/extensions/active_tab_permission_granter.cc

Issue 296483011: Run any pending injections in ActiveScriptController if permission is granted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ben's Created 6 years, 7 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/browser/extensions/active_script_controller_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/active_tab_permission_granter.cc
diff --git a/chrome/browser/extensions/active_tab_permission_granter.cc b/chrome/browser/extensions/active_tab_permission_granter.cc
index 16099220957a21243dace3eb369836e7d795d89c..d508f557b36f899f8a52042c2adc136dd8a02e13 100644
--- a/chrome/browser/extensions/active_tab_permission_granter.cc
+++ b/chrome/browser/extensions/active_tab_permission_granter.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/active_tab_permission_granter.h"
+#include "chrome/browser/extensions/active_script_controller.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
@@ -83,6 +84,13 @@ void ActiveTabPermissionGranter::GrantIfRequested(const Extension* extension) {
tab_id_,
extension->id(),
new_hosts));
+ // If more things ever need to know about this, we should consider making
+ // an observer class.
+ // It's important that this comes after the IPC is sent to the renderer,
+ // so that any tasks executing in the renderer occur after it has the
+ // updated permissions.
+ ActiveScriptController::GetForWebContents(web_contents())
+ ->OnActiveTabPermissionGranted(extension);
}
}
}
« no previous file with comments | « chrome/browser/extensions/active_script_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698