| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 package com.dom_distiller.client; | 5 package com.dom_distiller.client; |
| 6 | 6 |
| 7 import com.google.gwt.dom.client.Document; | 7 import com.google.gwt.dom.client.Document; |
| 8 | 8 |
| 9 import com.google.gwt.json.client.JSONObject; | 9 import com.google.gwt.json.client.JSONObject; |
| 10 import java.util.logging.Logger; | 10 import java.util.logging.Logger; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return applyWithOptions(DomDistillerProtos.DomDistillerOptions.create()); | 21 return applyWithOptions(DomDistillerProtos.DomDistillerOptions.create()); |
| 22 } | 22 } |
| 23 | 23 |
| 24 public static DomDistillerProtos.DomDistillerResult applyWithOptions( | 24 public static DomDistillerProtos.DomDistillerResult applyWithOptions( |
| 25 DomDistillerProtos.DomDistillerOptions options) { | 25 DomDistillerProtos.DomDistillerOptions options) { |
| 26 DomDistillerProtos.DomDistillerResult result = DomDistillerProtos.DomDisti
llerResult.create(); | 26 DomDistillerProtos.DomDistillerResult result = DomDistillerProtos.DomDisti
llerResult.create(); |
| 27 result.setTitle(DocumentTitleGetter.getDocumentTitle( | 27 result.setTitle(DocumentTitleGetter.getDocumentTitle( |
| 28 Document.get().getTitle(), Document.get().getDocumentElement())); | 28 Document.get().getTitle(), Document.get().getDocumentElement())); |
| 29 | 29 |
| 30 DomDistillerProtos.DistilledContent content = DomDistillerProtos.Distilled
Content.create(); | 30 DomDistillerProtos.DistilledContent content = DomDistillerProtos.Distilled
Content.create(); |
| 31 content.setHtml(ContentExtractor.extractContent()); | 31 boolean text_only = options.hasExtractTextOnly() && options.getExtractText
Only(); |
| 32 content.setHtml(ContentExtractor.extractContent(text_only)); |
| 32 result.setDistilledContent(content); | 33 result.setDistilledContent(content); |
| 33 | 34 |
| 34 result.setPaginationInfo(PagingLinksFinder.getPaginationInfo()); | 35 result.setPaginationInfo(PagingLinksFinder.getPaginationInfo()); |
| 35 return result; | 36 return result; |
| 36 } | 37 } |
| 37 } | 38 } |
| OLD | NEW |