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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 article.authors = author.isEmpty() ? new String[0] : new String[] { auth
or }; | 103 article.authors = author.isEmpty() ? new String[0] : new String[] { auth
or }; |
104 return article; | 104 return article; |
105 } | 105 } |
106 | 106 |
107 @Override | 107 @Override |
108 public boolean optOut() { | 108 public boolean optOut() { |
109 if (!mDoneOptOut) findOptOut(); | 109 if (!mDoneOptOut) findOptOut(); |
110 return mOptOut; | 110 return mOptOut; |
111 } | 111 } |
112 | 112 |
| 113 @Override |
| 114 public String getStructuredData() { |
| 115 return ""; |
| 116 } |
| 117 |
113 private void findTitle() { | 118 private void findTitle() { |
114 init(); | 119 init(); |
115 mTitle = ""; | 120 mTitle = ""; |
116 | 121 |
117 if (mAllMeta.getLength() == 0) return; | 122 if (mAllMeta.getLength() == 0) return; |
118 | 123 |
119 // Make sure there's a <title> element. | 124 // Make sure there's a <title> element. |
120 NodeList<Element> titles = mRoot.getElementsByTagName("TITLE"); | 125 NodeList<Element> titles = mRoot.getElementsByTagName("TITLE"); |
121 if (titles.getLength() == 0) return; | 126 if (titles.getLength() == 0) return; |
122 | 127 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 if (numCaptions > 0 && numCaptions <= 2) { | 246 if (numCaptions > 0 && numCaptions <= 2) { |
242 // Use javascript innerText (instead of javascript textContent) to g
et only visible | 247 // Use javascript innerText (instead of javascript textContent) to g
et only visible |
243 // captions. | 248 // captions. |
244 for (int i = 0; i < numCaptions && caption.isEmpty(); i++) { | 249 for (int i = 0; i < numCaptions && caption.isEmpty(); i++) { |
245 caption = DomUtil.getInnerText(captions.getItem(i)); | 250 caption = DomUtil.getInnerText(captions.getItem(i)); |
246 } | 251 } |
247 } | 252 } |
248 return caption; | 253 return caption; |
249 } | 254 } |
250 } | 255 } |
OLD | NEW |