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

Unified Diff: ios/web/web_state/js/crw_js_injection_manager.mm

Issue 1107083002: Upstream more leaf files in ios/web/web_state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-resync
Patch Set: Created 5 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 | « ios/web/web_state/js/credential_util.mm ('k') | ios/web/web_state/js/crw_js_invoke_parameter_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/js/crw_js_injection_manager.mm
diff --git a/ios/web/web_state/js/crw_js_injection_manager.mm b/ios/web/web_state/js/crw_js_injection_manager.mm
index 00c3caa01d9e15c5cb6ca654452bb0b9aa5339b0..3b8e5dd7d43a4997dff410b6c8a7d52f31136299 100644
--- a/ios/web/web_state/js/crw_js_injection_manager.mm
+++ b/ios/web/web_state/js/crw_js_injection_manager.mm
@@ -11,6 +11,7 @@
#import "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
+#import "ios/web/web_state/js/page_script_util.h"
@implementation CRWJSInjectionManager {
// JS to inject into the page. This may be nil if it has been purged due to
@@ -111,18 +112,7 @@
}
- (NSString*)staticInjectionContent {
- DCHECK(self.scriptPath);
- NSString* path = [base::mac::FrameworkBundle() pathForResource:self.scriptPath
- ofType:@"js"];
- DCHECK(path) << "Script file not found: "
- << base::SysNSStringToUTF8(self.scriptPath) << ".js";
- NSError* error = nil;
- NSString* content = [NSString stringWithContentsOfFile:path
- encoding:NSUTF8StringEncoding
- error:&error];
- DCHECK(!error) << "Error fetching script: " << [error.description UTF8String];
- DCHECK(content);
- return content;
+ return web::GetPageScript([self scriptPath]);
}
- (void)injectDependenciesIfMissing {
« no previous file with comments | « ios/web/web_state/js/credential_util.mm ('k') | ios/web/web_state/js/crw_js_invoke_parameter_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698