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

Side by Side Diff: ios/chrome/browser/dom_distiller/distiller_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 unified diff | Download patch
« no previous file with comments | « components/test/data/dom_distiller/pinch_tester.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chrome/browser/dom_distiller/distiller_viewer.h" 5 #include "ios/chrome/browser/dom_distiller/distiller_viewer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "components/dom_distiller/core/distilled_page_prefs.h" 9 #include "components/dom_distiller/core/distilled_page_prefs.h"
10 #include "components/dom_distiller/core/dom_distiller_request_view_base.h" 10 #include "components/dom_distiller/core/dom_distiller_request_view_base.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 void DistillerViewer::OnArticleReady( 43 void DistillerViewer::OnArticleReady(
44 const dom_distiller::DistilledArticleProto* article_proto) { 44 const dom_distiller::DistilledArticleProto* article_proto) {
45 DomDistillerRequestViewBase::OnArticleReady(article_proto); 45 DomDistillerRequestViewBase::OnArticleReady(article_proto);
46 46
47 const std::string html = viewer::GetUnsafeArticleTemplateHtml( 47 const std::string html = viewer::GetUnsafeArticleTemplateHtml(
48 url_.spec(), distilled_page_prefs_->GetTheme(), 48 url_.spec(), distilled_page_prefs_->GetTheme(),
49 distilled_page_prefs_->GetFontFamily()); 49 distilled_page_prefs_->GetFontFamily());
50 50
51 std::string html_and_script(html); 51 std::string html_and_script(html);
52 std::string hide_feedback = 52 html_and_script +=
53 "document.getElementById('feedbackContainer').style.display = 'none';"; 53 "<script> distiller_on_ios = true; " + js_buffer_ + "</script>";
54 html_and_script += "<script>" + js_buffer_ + hide_feedback + "</script>";
55 callback_.Run(url_, html_and_script); 54 callback_.Run(url_, html_and_script);
56 } 55 }
57 56
58 void DistillerViewer::SendJavaScript(const std::string& buffer) { 57 void DistillerViewer::SendJavaScript(const std::string& buffer) {
59 js_buffer_ += buffer; 58 js_buffer_ += buffer;
60 } 59 }
61 60
62 } // namespace dom_distiller 61 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/test/data/dom_distiller/pinch_tester.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698