| Index: chrome/renderer/blocked_plugin.cc
|
| ===================================================================
|
| --- chrome/renderer/blocked_plugin.cc (revision 71691)
|
| +++ chrome/renderer/blocked_plugin.cc (working copy)
|
| @@ -7,6 +7,7 @@
|
| #include "app/l10n_util.h"
|
| #include "app/resource_bundle.h"
|
| #include "base/string_piece.h"
|
| +#include "base/string_util.h"
|
| #include "base/values.h"
|
| #include "chrome/common/jstemplate_builder.h"
|
| #include "chrome/common/render_messages.h"
|
| @@ -188,11 +189,19 @@
|
| if (element.hasAttribute("width") && element.hasAttribute("height")) {
|
| std::string width_str("width:[\\s]*");
|
| width_str += element.getAttribute("width").utf8().data();
|
| + if (EndsWith(width_str, "px", false)) {
|
| + width_str = width_str.substr(0, width_str.length() - 2);
|
| + }
|
| + TrimWhitespace(width_str, TRIM_TRAILING, &width_str);
|
| width_str += "[\\s]*px";
|
| WebRegularExpression width_regex(WebString::fromUTF8(width_str.c_str()),
|
| WebKit::WebTextCaseSensitive);
|
| std::string height_str("height:[\\s]*");
|
| height_str += element.getAttribute("height").utf8().data();
|
| + if (EndsWith(height_str, "px", false)) {
|
| + height_str = height_str.substr(0, height_str.length() - 2);
|
| + }
|
| + TrimWhitespace(height_str, TRIM_TRAILING, &height_str);
|
| height_str += "[\\s]*px";
|
| WebRegularExpression height_regex(WebString::fromUTF8(height_str.c_str()),
|
| WebKit::WebTextCaseSensitive);
|
|
|