summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-01 15:48:37 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-01 15:48:37 +0000
commit5ddfd63e1be6378721913af1f26fa1d4cbf09c5d (patch)
tree01af8f99ac0a2deaf6e63caea891a736bfa4fde1 /webkit
parent203c78635602da82ca215b188362c85d60fc306a (diff)
downloadchromium_src-5ddfd63e1be6378721913af1f26fa1d4cbf09c5d.zip
chromium_src-5ddfd63e1be6378721913af1f26fa1d4cbf09c5d.tar.gz
chromium_src-5ddfd63e1be6378721913af1f26fa1d4cbf09c5d.tar.bz2
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
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/dom_operations.cc11
-rw-r--r--webkit/glue/dom_operations.h11
2 files changed, 12 insertions, 10 deletions
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<WebElement>* meta_elements) {
+void GetMetaElementsWithAttribute(WebDocument* document,
+ const string16& attribute_name,
+ const string16& attribute_value,
+ std::vector<WebElement>* meta_elements) {
DCHECK(document);
DCHECK(meta_elements);
meta_elements->clear();
@@ -610,8 +611,8 @@ void GetMetaElementsWithName(WebDocument* document,
WebElement element = node.to<WebElement>();
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<WebKit::WebElement>* 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<WebKit::WebElement>* meta_elements);
} // namespace webkit_glue