Index: components/dom_distiller/core/viewer.cc |
diff --git a/components/dom_distiller/core/viewer.cc b/components/dom_distiller/core/viewer.cc |
index 00e05ca447e2a8665bdffd1376ef9a5a590d91c5..9d9b4ee4b911f12a90b3e5d01bb63c7abcc18b85 100644 |
--- a/components/dom_distiller/core/viewer.cc |
+++ b/components/dom_distiller/core/viewer.cc |
@@ -113,8 +113,22 @@ std::string ReplaceHtmlTemplateValues( |
IDR_DOM_DISTILLER_VIEWER_HTML); |
std::vector<std::string> substitutions; |
substitutions.push_back(title); // $1 |
- substitutions.push_back(kViewerCssPath); // $2 |
- substitutions.push_back(kViewerJsPath); // $3 |
+#if defined(OS_IOS) |
+ // On iOS the content is inlined as there is no API to detect those requests |
+ // and return the local data once a page is loaded. |
+ substitutions.push_back(viewer::GetCss()); // $2 |
cjhopman
2015/03/25 02:25:11
This now needs <style>...</style>?
noyau (Ping after 24h)
2015/03/25 10:36:01
That's what happen when you push code late in the
|
+ std::ostringstream script; |
+ script << "<script>\n" << viewer::GetJavaScript() << "\n</script>"; |
+ substitutions.push_back(script.str()); // $3 |
+#else |
+ std::ostringstream css; |
+ css << "<link rel=\"stylesheet\" href=\"/" << kViewerCssPath << "\">"; |
+ substitutions.push_back(css.str()); // $2 |
+ std::ostringstream script; |
+ script << "<script src=\"" << kViewerJsPath << "\"></script>"; |
+ substitutions.push_back(script.str()); // $3 |
+#endif // defined(OS_IOS) |
+ |
substitutions.push_back(GetThemeCssClass(theme) + " " + |
GetFontCssClass(font_family)); // $4 |
substitutions.push_back(content); // $5 |