OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ios/web/webui/crw_web_ui_page_builder.h" | 5 #import "ios/web/webui/crw_web_ui_page_builder.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/mac/bundle_locations.h" | 12 #include "base/mac/bundle_locations.h" |
13 #include "base/mac/scoped_nsobject.h" | 13 #import "base/mac/scoped_nsobject.h" |
14 #include "base/strings/sys_string_conversions.h" | 14 #include "base/strings/sys_string_conversions.h" |
15 | 15 |
16 #if !defined(__has_feature) || !__has_feature(objc_arc) | 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
17 #error "This file requires ARC support." | 17 #error "This file requires ARC support." |
18 #endif | 18 #endif |
19 | 19 |
20 namespace { | 20 namespace { |
21 // Prefix for script tags. Used to locate JavaScript subresources. | 21 // Prefix for script tags. Used to locate JavaScript subresources. |
22 NSString* const kJSTagPrefix = @"<script src=\""; | 22 NSString* const kJSTagPrefix = @"<script src=\""; |
23 // Suffix for script tags. Used to locate JavaScript subresources. | 23 // Suffix for script tags. Used to locate JavaScript subresources. |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 - (NSString*)webUIJavaScript { | 325 - (NSString*)webUIJavaScript { |
326 NSBundle* bundle = base::mac::FrameworkBundle(); | 326 NSBundle* bundle = base::mac::FrameworkBundle(); |
327 NSString* path = [bundle pathForResource:@"web_ui_bundle" ofType:@"js"]; | 327 NSString* path = [bundle pathForResource:@"web_ui_bundle" ofType:@"js"]; |
328 DCHECK(path) << "web_ui_bundle.js file not found"; | 328 DCHECK(path) << "web_ui_bundle.js file not found"; |
329 return [NSString stringWithContentsOfFile:path | 329 return [NSString stringWithContentsOfFile:path |
330 encoding:NSUTF8StringEncoding | 330 encoding:NSUTF8StringEncoding |
331 error:nil]; | 331 error:nil]; |
332 } | 332 } |
333 | 333 |
334 @end | 334 @end |
OLD | NEW |