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

Side by Side Diff: java/org/chromium/distiller/OpenGraphProtocolParser.java

Issue 1705123002: Add support for Schema.org/Recipe Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: Created 4 years, 10 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
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 org.chromium.distiller; 5 package org.chromium.distiller;
6 6
7 import org.chromium.distiller.proto.DomDistillerProtos.TimingInfo; 7 import org.chromium.distiller.proto.DomDistillerProtos.TimingInfo;
8 8
9 import com.google.gwt.core.client.JsArray; 9 import com.google.gwt.core.client.JsArray;
10 import com.google.gwt.dom.client.Element; 10 import com.google.gwt.dom.client.Element;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 return article; 218 return article;
219 } 219 }
220 220
221 @Override 221 @Override
222 public boolean optOut() { 222 public boolean optOut() {
223 // While this is not directly supported, the page owner can simply omit the required tags 223 // While this is not directly supported, the page owner can simply omit the required tags
224 // and parse() will return a null OpenGraphProtocolParser. 224 // and parse() will return a null OpenGraphProtocolParser.
225 return false; 225 return false;
226 } 226 }
227 227
228 @Override
229 public String getStructuredData() {
230 return "";
231 }
232
228 /** 233 /**
229 * The object that has successfully extracted OpenGraphProtocol markup infor mation from |root|. 234 * The object that has successfully extracted OpenGraphProtocol markup infor mation from |root|.
230 * 235 *
231 * @throws Exception if the properties do not conform to the procotol i.e. n ot all required 236 * @throws Exception if the properties do not conform to the procotol i.e. n ot all required
232 * properties exist. 237 * properties exist.
233 */ 238 */
234 private OpenGraphProtocolParser(Element root, TimingInfo timingInfo) throws Exception { 239 private OpenGraphProtocolParser(Element root, TimingInfo timingInfo) throws Exception {
235 mPropertyTable = new HashMap<String, String>(); 240 mPropertyTable = new HashMap<String, String>();
236 mPrefixes = new EnumMap<Prefix, String>(Prefix.class); 241 mPrefixes = new EnumMap<Prefix, String>(Prefix.class);
237 mTimingInfo = timingInfo; 242 mTimingInfo = timingInfo;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 mCheckedType = false; 531 mCheckedType = false;
527 mIsArticleType = false; 532 mIsArticleType = false;
528 mAuthors = new ArrayList<String>(); 533 mAuthors = new ArrayList<String>();
529 } 534 }
530 535
531 private String[] getAuthors() { 536 private String[] getAuthors() {
532 return mAuthors.toArray(new String[mAuthors.size()]); 537 return mAuthors.toArray(new String[mAuthors.size()]);
533 } 538 }
534 } 539 }
535 } 540 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698