- cefclient: Add background-color command-line argument (issue #1161).

- Rename cef_url.h to cef_parser.h.
- Add new CefParseCSSColor function.
This commit is contained in:
Marshall Greenblatt
2015-04-09 16:59:34 +02:00
parent 2c03492160
commit ae91d8f4e5
33 changed files with 645 additions and 434 deletions

View File

@ -25,6 +25,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "third_party/WebKit/public/web/WebNode.h"
#include "third_party/WebKit/public/web/WebViewClient.h"
#include "third_party/WebKit/Source/core/css/parser/CSSParser.h"
#include "third_party/WebKit/Source/core/dom/Node.h"
#include "third_party/WebKit/Source/web/WebLocalFrameImpl.h"
#include "third_party/WebKit/Source/web/WebViewImpl.h"
@ -121,4 +122,18 @@ blink::WebFrame* FindFrameByUniqueName(const blink::WebString& unique_name,
return NULL;
}
bool ParseCSSColor(const blink::WebString& string, bool strict, SkColor& color) {
blink::RGBA32 rgba_color =
blink::makeRGBA(SkColorGetR(color), SkColorGetG(color),
SkColorGetB(color), SkColorGetA(color));
if (!blink::CSSParser::parseColor(rgba_color, string, strict))
return false;
color = SkColorSetARGB(blink::alphaChannel(rgba_color),
blink::redChannel(rgba_color),
blink::greenChannel(rgba_color),
blink::blueChannel(rgba_color));
return true;
}
} // webkit_glue