- 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

View File

@@ -8,6 +8,7 @@
#include <string>
#include "base/basictypes.h"
#include "third_party/skia/include/core/SkColor.h"
namespace v8 {
class Context;
@@ -43,6 +44,8 @@ int64 GetIdentifier(blink::WebFrame* frame);
blink::WebFrame* FindFrameByUniqueName(const blink::WebString& unique_name,
blink::WebFrame* relative_to_frame);
bool ParseCSSColor(const blink::WebString& string, bool strict, SkColor& color);
} // webkit_glue
#endif // CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_