Cef概览
2016-02-18 15:12
375 查看
CEF General Usage(CEF3预览)
介绍
CEF全称Chromium Embedded Framework,是一个基于Google Chromium 的开源项目。Google Chromium项目主要是为Google Chrome应用开发的,而CEF的目标则是为第三方应用提供可嵌入浏览器支持。CEF隔离底层Chromium和Blink的复杂代码,并提供一套产品级稳定的API,发布跟踪具体Chromium版本的分支,以及二进制包。CEF的大部分特性都提供了丰富的默认实现,让使用者做尽量少的定制即可满足需求。在本文发布的时候,世界上已经有很多公司和机构采用CEF,CEF的安装量超过了100万。[CEFwikipedia]页面上有使用CEF的公司和机构的不完全的列表。CEF的典型应用场景包括:
嵌入一个兼容HTML5的浏览器控件到一个已经存在的本地应用。
创建一个轻量化的壳浏览器,用以托管主要用Web技术开发的应用。
有些应用有独立的绘制框架,使用CEF对Web内容做离线渲染。
使用CEF做自动化Web测试。
CEF3是基于Chomuim Content API多进程构架的下一代CEF,拥有下列优势:
改进的性能和稳定性(JavaScript和插件在一个独立的进程内执行)。
支持Retina显示器
支持WebGL和3D CSS的GPU加速
类似WebRTC和语音输入这样的前卫特性。
通过DevTools远程调试协议以及ChromeDriver2提供更好的自动化UI测试
更快获得当前以及未来的Web特性和标准的能力
本文档介绍CEF3开发中涉及到的一般概念。
开始
使用二进制包
CEF3的二进制包可以在这个页面下载。其中包含了在特定平台(Windows,Mac OS X 以及 Linux)编译特定版本CEF3所需的全部文件。不同平台拥有共同的结构:cefclient
Debug
include
libcef_dll
Release
Resources
tools
Each binary distribution also contains a README.txt file that describes the platform-specific distribution in greater detail and a LICENSE.txt file that contains CEF’s BSD license. When distributing an application based on CEF you should include the license
text somewhere in your application’s distribution. For example, you can list it on an “About” or “Credits” page in your application’s UI, or in the documentation bundled with your application. License and credit information is also available inside of a CEF3
browser window by loading “about:license” and “about:credits” respectively.
Applications based on CEF binary distributions can be built using standard platform build tools. This includes Visual Studio on Windows, Xcode on Mac OS X and gcc/make on Linux. The project Downloads page contains information about the OS and build tool versions
required for specific binary releases. When building on Linux also pay careful attention to the listed package dependencies.
See the Tutorial Wiki page for detailed instructions on how to create a simple application using the CEF3 binary distribution.
Building from Source Code
CEF can be built from source code either locally or using automated build systems like TeamCity. This requires the download of Chromium and CEF source code via either Subversion (SVN) or Git. The Chromium code base is quite large and building Chromium fromsource code is only recommended on moderately powerful machines with more than 4GB of RAM. Detailed instructions for building Chromium and CEF from source code are available on the BranchesAndBuilding page.
Sample Application
示例应用程序The cefclient sample application is a complete working example of CEF integration and is included in source code form with each binary distribution. The easiest way to create a new application using CEF is to start with the cefclient application and remove
the parts that you don’t need. Many of the examples in this document originate from the cefclient application.
cefclient是一个完整的CEF客户端应用程序示例,并且它的源码包含在CEF每个二进制发布包中。使用CEF创建一个新的应用程序,最简单的方法是先从cefclient应用程序开始,删除你不需要的部分。本文档中许多示例都是来源于cefclient应用程序。
相关文章推荐
- 使用C++实现JNI接口需要注意的事项
- Android学习笔记(二九):嵌入浏览器
- 关于指针的一些事情
- 受 Mozilla 启发,苹果宣布更新 WebKit 反跟踪政策
- Apple宣布推出WebKit跟踪预防政策以保护用户隐私
- c++ primer 第五版 笔记前言
- share_ptr的几个注意点
- Lua中调用C++函数示例
- Lua教程(一):在C++中嵌入Lua脚本
- Lua教程(二):C++和Lua相互传递数据示例
- C++联合体转换成C#结构的实现方法
- C++高级程序员成长之路
- C++编写简单的打靶游戏
- C++ 自定义控件的移植问题
- C++变位词问题分析
- C/C++数据对齐详细解析
- C++基于栈实现铁轨问题
- C++中引用的使用总结
- 使用Lua来扩展C++程序的方法
- C++中调用Lua函数实例