| 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.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 Loading... |
| 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 } |
| OLD | NEW |