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

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

Issue 661883003: add option for original domain (Closed) Base URL: https://code.google.com/p/dom-distiller/@master
Patch Set: rm empty line Created 6 years, 2 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 | « proto/dom_distiller.proto ('k') | src/com/dom_distiller/client/PagingLinksFinder.java » ('j') | 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.dom_distiller.proto.DomDistillerProtos; 7 import com.dom_distiller.proto.DomDistillerProtos;
8 import com.dom_distiller.proto.DomDistillerProtos.DebugInfo; 8 import com.dom_distiller.proto.DomDistillerProtos.DebugInfo;
9 import com.dom_distiller.proto.DomDistillerProtos.TimingInfo; 9 import com.dom_distiller.proto.DomDistillerProtos.TimingInfo;
10 import com.google.gwt.dom.client.Document; 10 import com.google.gwt.dom.client.Document;
(...skipping 17 matching lines...) Expand all
28 result.setTitle(contentExtractor.extractTitle()); 28 result.setTitle(contentExtractor.extractTitle());
29 29
30 LogUtil.setDebugLevel( 30 LogUtil.setDebugLevel(
31 options.hasDebugLevel() ? options.getDebugLevel() : LogUtil.DEBU G_LEVEL_NONE); 31 options.hasDebugLevel() ? options.getDebugLevel() : LogUtil.DEBU G_LEVEL_NONE);
32 LogUtil.logToConsole("DomDistiller debug level: " + LogUtil.getDebugLeve l()); 32 LogUtil.logToConsole("DomDistiller debug level: " + LogUtil.getDebugLeve l());
33 33
34 DomDistillerProtos.DistilledContent content = DomDistillerProtos.Distill edContent.create(); 34 DomDistillerProtos.DistilledContent content = DomDistillerProtos.Distill edContent.create();
35 boolean textOnly = options.hasExtractTextOnly() && options.getExtractTex tOnly(); 35 boolean textOnly = options.hasExtractTextOnly() && options.getExtractTex tOnly();
36 content.setHtml(contentExtractor.extractContent(textOnly)); 36 content.setHtml(contentExtractor.extractContent(textOnly));
37 result.setDistilledContent(content); 37 result.setDistilledContent(content);
38 result.setPaginationInfo(PagingLinksFinder.getPaginationInfo()); 38 String original_domain = options.hasOriginalDomain() ? options.getOrigin alDomain() : "";
39 result.setPaginationInfo(PagingLinksFinder.getPaginationInfo(original_do main));
39 result.setMarkupInfo(contentExtractor.getMarkupParser().getMarkupInfo()) ; 40 result.setMarkupInfo(contentExtractor.getMarkupParser().getMarkupInfo()) ;
40 TimingInfo timingInfo = contentExtractor.getTimingInfo(); 41 TimingInfo timingInfo = contentExtractor.getTimingInfo();
41 timingInfo.setTotalTime(DomUtil.getTime() - startTime); 42 timingInfo.setTotalTime(DomUtil.getTime() - startTime);
42 result.setTimingInfo(timingInfo); 43 result.setTimingInfo(timingInfo);
43 result.setStatisticsInfo(contentExtractor.getStatisticsInfo()); 44 result.setStatisticsInfo(contentExtractor.getStatisticsInfo());
44 DebugInfo debugInfo = DebugInfo.create(); 45 DebugInfo debugInfo = DebugInfo.create();
45 debugInfo.setLog(LogUtil.getAndClearLog()); 46 debugInfo.setLog(LogUtil.getAndClearLog());
46 result.setDebugInfo(debugInfo); 47 result.setDebugInfo(debugInfo);
47 return result; 48 return result;
48 } 49 }
49 } 50 }
OLDNEW
« no previous file with comments | « proto/dom_distiller.proto ('k') | src/com/dom_distiller/client/PagingLinksFinder.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698