| 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/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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "components/dom_distiller/core/distilled_page_prefs.h" | 10 #include "components/dom_distiller/core/distilled_page_prefs.h" |
| 11 #include "components/dom_distiller/core/dom_distiller_request_view_base.h" | 11 #include "components/dom_distiller/core/dom_distiller_request_view_base.h" |
| 12 #include "components/dom_distiller/core/dom_distiller_service.h" | 12 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 13 #include "components/dom_distiller/core/proto/distilled_article.pb.h" | 13 #include "components/dom_distiller/core/proto/distilled_article.pb.h" |
| 14 #include "components/dom_distiller/core/task_tracker.h" | 14 #include "components/dom_distiller/core/task_tracker.h" |
| 15 #include "components/dom_distiller/core/viewer.h" | 15 #include "components/dom_distiller/core/viewer.h" |
| 16 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 16 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 17 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 17 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" | |
| 18 #include "ui/gfx/geometry/size.h" | 18 #include "ui/gfx/geometry/size.h" |
| 19 | 19 |
| 20 namespace dom_distiller { | 20 namespace dom_distiller { |
| 21 | 21 |
| 22 DistillerViewer::DistillerViewer(ios::ChromeBrowserState* browser_state, | 22 DistillerViewer::DistillerViewer(ios::ChromeBrowserState* browser_state, |
| 23 const GURL& url, | 23 const GURL& url, |
| 24 const DistillationFinishedCallback& callback) | 24 const DistillationFinishedCallback& callback) |
| 25 : DomDistillerRequestViewBase( | 25 : DomDistillerRequestViewBase( |
| 26 new DistilledPagePrefs(browser_state->GetPrefs())), | 26 new DistilledPagePrefs(browser_state->GetPrefs())), |
| 27 url_(url), | 27 url_(url), |
| (...skipping 25 matching lines...) Expand all Loading... |
| 53 html_and_script += | 53 html_and_script += |
| 54 "<script> distiller_on_ios = true; " + js_buffer_ + "</script>"; | 54 "<script> distiller_on_ios = true; " + js_buffer_ + "</script>"; |
| 55 callback_.Run(url_, html_and_script); | 55 callback_.Run(url_, html_and_script); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void DistillerViewer::SendJavaScript(const std::string& buffer) { | 58 void DistillerViewer::SendJavaScript(const std::string& buffer) { |
| 59 js_buffer_ += buffer; | 59 js_buffer_ += buffer; |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace dom_distiller | 62 } // namespace dom_distiller |
| OLD | NEW |