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

Side by Side Diff: src/com/dom_distiller/client/DomDistiller.java

Issue 286453002: Add extract_text_only option (Closed) Base URL: https://code.google.com/p/dom-distiller/@master
Patch Set: Rebase Created 6 years, 7 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 | « src/com/dom_distiller/client/ContentExtractor.java ('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 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
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 }
OLDNEW
« no previous file with comments | « src/com/dom_distiller/client/ContentExtractor.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698