Fix content script injection not working with PlzNavigate because of different navigation timings.

Without PlzNavigat, when a frame is created it will have a provisional load URL at the start. With PlzNavigate, this will only be set once the load is completed. ProgrammaticScriptInjector was caching the frame's URL too early and was getting an empty URL as a result. Fix this by calculating it later when it's needed, since at that point it's guaranteed that the frame would have loaded.

This fixes
ExtensionApiTest.Incognito
ExtensionApiTest.JavaScriptURLPermissions
ExtensionApiTest.JavasScriptEncodedURL
with PlzNavigate.

BUG=504347

Review-Url: https://codereview.chromium.org/2471553003
Cr-Commit-Position: refs/heads/master@{#429174}
diff --git a/extensions/renderer/script_injector.h b/extensions/renderer/script_injector.h
index cdc3741..38c072de 100644
--- a/extensions/renderer/script_injector.h
+++ b/extensions/renderer/script_injector.h
@@ -64,7 +64,7 @@
   virtual PermissionsData::AccessType CanExecuteOnFrame(
       const InjectionHost* injection_host,
       blink::WebLocalFrame* web_frame,
-      int tab_id) const = 0;
+      int tab_id) = 0;
 
   // Returns the javascript sources to inject at the given |run_location|.
   // Only called if ShouldInjectJs() is true.