Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebDocument.cpp |
| diff --git a/third_party/WebKit/Source/web/WebDocument.cpp b/third_party/WebKit/Source/web/WebDocument.cpp |
| index 26f088f28b54f3237bcfe5ef412fc80c929e0bd1..ba87a12bd7d81f710aadb58ab3b9079bdcde0b8f 100644 |
| --- a/third_party/WebKit/Source/web/WebDocument.cpp |
| +++ b/third_party/WebKit/Source/web/WebDocument.cpp |
| @@ -92,6 +92,30 @@ WebString WebDocument::contentLanguage() const { |
| return constUnwrap<Document>()->contentLanguage(); |
| } |
| +WebString WebDocument::documentLanguage() const { |
|
dglazkov
2016/12/16 23:00:28
Don't need that anymore, right?
|
| + return constUnwrap<Document>()->documentLanguage(); |
| +} |
| + |
| +WebVector<WebString> WebDocument::getMetaValues(const WebString& name) const { |
|
dglazkov
2016/12/16 23:00:28
... Or that.
|
| + return constUnwrap<Document>()->getMetaValues(name); |
| +} |
| + |
| +WebLanguageDetectionDetails WebDocument::collectLanguageDetectionDetails() |
| + const { |
| + WebLanguageDetectionDetails details; |
| + details.contentLanguage = contentLanguage(); |
| + details.htmlLanguage = documentLanguage(); |
| + details.url = url(); |
| + |
| + WebVector<WebString> values = getMetaValues(WebString("google")); |
| + details.hasNoTranslateMeta = |
| + std::any_of(values.begin(), values.end(), [](const WebString& value) { |
| + return equalIgnoringASCIICase(value, "notranslate"); |
| + }); |
| + |
| + return details; |
| +} |
| + |
| WebString WebDocument::referrer() const { |
| return constUnwrap<Document>()->referrer(); |
| } |