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

Unified Diff: components/dom_distiller/core/viewer.cc

Issue 1160113004: HTML exit reader view button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up Created 5 years, 6 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 | « components/dom_distiller/core/viewer.h ('k') | components/dom_distiller_strings.grdp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/viewer.cc
diff --git a/components/dom_distiller/core/viewer.cc b/components/dom_distiller/core/viewer.cc
index 60ea7f10b638fffe20ca58e67928465fff4bfecf..0c1732f214463ae53e78bfe357a962fe39d6058b 100644
--- a/components/dom_distiller/core/viewer.cc
+++ b/components/dom_distiller/core/viewer.cc
@@ -117,7 +117,7 @@ std::string ReplaceHtmlTemplateValues(
#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.
- css << "<style>" << viewer::GetCss() << "</style>";
+ css << "<style>" << viewer::GetCss() << viewer::GetIOSCss() << "</style>";
script << "<script>\n" << viewer::GetJavaScript() << "\n</script>";
#else
css << "<link rel=\"stylesheet\" href=\"/" << kViewerCssPath << "\">";
@@ -139,7 +139,8 @@ std::string ReplaceHtmlTemplateValues(
substitutions.push_back(original_url); // $6
substitutions.push_back(
- l10n_util::GetStringUTF8(IDS_DOM_DISTILLER_VIEWER_VIEW_ORIGINAL)); // $7
+ l10n_util::GetStringUTF8(
+ IDS_DOM_DISTILLER_VIEWER_CLOSE_READER_VIEW)); // $7
substitutions.push_back(script.str()); // $8
@@ -245,6 +246,11 @@ const std::string GetCss() {
IDR_DISTILLER_CSS).as_string();
}
+const std::string GetIOSCss() {
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(
+ IDR_DISTILLER_IOS_CSS).as_string();
+}
+
const std::string GetJavaScript() {
return ResourceBundle::GetSharedInstance()
.GetRawDataResource(IDR_DOM_DISTILLER_VIEWER_JS)
« no previous file with comments | « components/dom_distiller/core/viewer.h ('k') | components/dom_distiller_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698