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 org.chromium.distiller; | 5 package org.chromium.distiller; |
6 | 6 |
7 import com.google.gwt.dom.client.Element; | 7 import com.google.gwt.dom.client.Element; |
8 import com.google.gwt.dom.client.ImageElement; | 8 import com.google.gwt.dom.client.ImageElement; |
9 import com.google.gwt.dom.client.MetaElement; | 9 import com.google.gwt.dom.client.MetaElement; |
10 import com.google.gwt.dom.client.NodeList; | 10 import com.google.gwt.dom.client.NodeList; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 article.authors = author.isEmpty() ? new String[0] : new String[] { auth
or }; | 97 article.authors = author.isEmpty() ? new String[0] : new String[] { auth
or }; |
98 return article; | 98 return article; |
99 } | 99 } |
100 | 100 |
101 @Override | 101 @Override |
102 public boolean optOut() { | 102 public boolean optOut() { |
103 if (!mDoneOptOut) findOptOut(); | 103 if (!mDoneOptOut) findOptOut(); |
104 return mOptOut; | 104 return mOptOut; |
105 } | 105 } |
106 | 106 |
| 107 @Override |
| 108 public String getStructuredData() { |
| 109 return ""; |
| 110 } |
| 111 |
107 private void findTitle() { | 112 private void findTitle() { |
108 mTitle = ""; | 113 mTitle = ""; |
109 | 114 |
110 if (mAllMeta.getLength() == 0) return; | 115 if (mAllMeta.getLength() == 0) return; |
111 | 116 |
112 // Make sure there's a <title> element. | 117 // Make sure there's a <title> element. |
113 NodeList<Element> titles = mRoot.getElementsByTagName("TITLE"); | 118 NodeList<Element> titles = mRoot.getElementsByTagName("TITLE"); |
114 if (titles.getLength() == 0) return; | 119 if (titles.getLength() == 0) return; |
115 | 120 |
116 // Extract title text from meta tag with "title" as name. | 121 // Extract title text from meta tag with "title" as name. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // Use javascript textContent (instead of javascript innerText) to i
nclude invisible | 250 // Use javascript textContent (instead of javascript innerText) to i
nclude invisible |
246 // text. | 251 // text. |
247 if (DomUtil.javascriptTextContent( | 252 if (DomUtil.javascriptTextContent( |
248 bodies.getItem(i)).toLowerCase().contains(lowerText)) { | 253 bodies.getItem(i)).toLowerCase().contains(lowerText)) { |
249 return true; | 254 return true; |
250 } | 255 } |
251 } | 256 } |
252 return false; | 257 return false; |
253 } | 258 } |
254 } | 259 } |
OLD | NEW |