From 5ddfd63e1be6378721913af1f26fa1d4cbf09c5d Mon Sep 17 00:00:00 2001 From: "jcivelli@chromium.org" Date: Wed, 1 Sep 2010 15:48:37 +0000 Subject: This CL ensures we use the language specified in the language meta tag if any. Also IsPageTranslatable was moved to TranslateHelper as it is where it belongs. BUG=51454 TEST=Run the browser tests. Review URL: http://codereview.chromium.org/3236008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58175 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/dom_operations.cc | 11 ++++++----- webkit/glue/dom_operations.h | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'webkit/glue') diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc index b39943f..724e200 100644 --- a/webkit/glue/dom_operations.cc +++ b/webkit/glue/dom_operations.cc @@ -592,9 +592,10 @@ int NumberOfActiveAnimations(WebView* view) { return controller->numberOfActiveAnimations(); } -void GetMetaElementsWithName(WebDocument* document, - const string16& name, - std::vector* meta_elements) { +void GetMetaElementsWithAttribute(WebDocument* document, + const string16& attribute_name, + const string16& attribute_value, + std::vector* meta_elements) { DCHECK(document); DCHECK(meta_elements); meta_elements->clear(); @@ -610,8 +611,8 @@ void GetMetaElementsWithName(WebDocument* document, WebElement element = node.to(); if (!element.hasTagName("meta")) continue; - WebString meta_name = element.getAttribute("name"); - if (meta_name.isNull() || meta_name != name) + WebString value = element.getAttribute(attribute_name); + if (value.isNull() || value != attribute_value) continue; meta_elements->push_back(element); } diff --git a/webkit/glue/dom_operations.h b/webkit/glue/dom_operations.h index a2dac8c..20084f7 100644 --- a/webkit/glue/dom_operations.h +++ b/webkit/glue/dom_operations.h @@ -132,11 +132,12 @@ int NumberOfActiveAnimations(WebKit::WebView* view); WebKit::WebString GetSubResourceLinkFromElement( const WebKit::WebElement& element); -// Puts the meta-elements of |document| that have the specified |name| in -// |meta_elements|. -void GetMetaElementsWithName(WebKit::WebDocument* document, - const string16& name, - std::vector* meta_elements); +// Puts the meta-elements of |document| that have the attribute |attribute_name| +// with a value of |attribute_value| in |meta_elements|. +void GetMetaElementsWithAttribute(WebKit::WebDocument* document, + const string16& attribute_name, + const string16& atribute_value, + std::vector* meta_elements); } // namespace webkit_glue -- cgit v1.1