Embedding Flash Fullscreen in the Browser Window
Embedding Flash Fullscreen in the Browser Window
Author: Yuri Wiitala (miu@chromium.org)ObjectiveEnhance the [Pepper] Flash fullscreen user experience in Chromium to match the HTML5 fullscreen experience. This would provide users with a single, consistent fullscreen-mode experience, with Flash fullscreen gaining the improved window/desktop management behaviors of HTML5 fullscreen. For example, on Mac, one cannot switch to other apps from Flash fullscreen, but this action is intelligently handled in the HTML5 fullscreen case. Side note: Later on, we seek to improve the fullscreen UX further by introducing a new "Fullscreen in Tab" concept for tab capture/screencasting (http://crbug.com/256870). While a user is "casting," fullscreen content is being displayed on a remote screen. Therefore, the local screen should be usable for other tabs or applications. The changes proposed in this document are a necessary prerequisite for this. Background Currently, Flash fullscreen is implemented in the "content" component where a raw, platform-dependent fullscreen window is created. Some minimal focus/keyboard control logic is added to support exit and mouse-lock. The entire stack assumes the Flash plugin handles the user permissions with respect to allowing fullscreen and/or mouse-locking, and so blindly allows all requests. Fullscreen mode is initiated by the render process, which is proxying the request from the Pepper Flash process. It sends a "create" message followed immediately by a "show" message. Once the fullscreen window is shown, a resize message is sent back to the renderer as a signal that painting may begin. The control flow for entering and exiting Flash fullscreen is as follows: On the other hand, the Browser (user-initiated, "F11") and Tab/HTML5 (renderer-initiated) fullscreen modes are controlled by the browser UI implementation in the "chrome" component, one abstraction level higher. The browser uses FullscreenController to manage the window sizing and show "permissions balloons" for both modes, and handles the transitions of switching in-between or in-and-out. To engage fullscreen mode for an HTML5 element, the renderer sends a "toggle" message to the browser process. Unlike Flash fullscreen, no new widgets are created. FullscreenController instructs the browser window to expand to fill the screen, and this causes the tab content view to be resized via the layout process. Then, the renderer process receives a resize message signalling that fullscreen mode is on. The originating HTML5 element (e.g., a video element), will then be resized to fill the content area. The control flow for entering and exiting HTML5 fullscreen is as follows: Thus, there exist two separate fullscreen control/view implementations in Chromium that operate independently and at different component layers. There actually exists a conflict, should a page choose to initiate HTML5 fullscreen during Flash fullscreen or vice versa. Observations and GoalsFortunately, there are key similarities between the implementations of Flash fullscreen and HTML5 fullscreen that suggests the former can be merged into the machinery of the latter. First, renderer-side, both send one or more messages to the browser process to engage fullscreen mode, and both expect an asynchronous ViewMsg_Resize message to confirm and receive the fullscreen dimensions. Second, browser-side, the messages from the renderer are handled by delegating to the same WebContentsImpl instance to initialize and kick-off. Finally, the browser process sends one or more ViewMsg_Resize messages to notify the renderer of "screen size" changes, and a ViewMsg_Close to shut down rendering of the widget. In the past, developing for the Pepper Flash plugin required overcoming very temperamental compatibility issues. Since one permeating goal is to ensure Flash fullscreen does not break, no changes will be made that could be observable by the renderer process (and, by proxy, the pepper flash plugin). This means no changes to IPC messaging, with the ordering and content of the messages being exactly the same as in the current implementation. If we are to proceed, one UX issue to resolve is the "Press Esc to Exit Fullscreen" message rendered by the Pepper Flash plugin: Ideally, for consistency, this would be removed in favor of the balloon pop-up shown by FullscreenController. If this is not possible, then the balloon pop-up should not be displayed for Flash. DesignA three-part change to the existing design is proposed. First, the Flash "fullscreen" render widget will become embedded within the browser window. More specifically, it will replace the normal tab content view in the view hierarchy and participate in layout like any other widget. The owner and creator of the widget will remain the same and, from the renderer's perspective, Flash will still be painting into its own dedicated "fullscreen" widget. Second, the FullscreenController will be used to manage the the sizing/expansion of the browser window for all fullscreen modes, including Flash, and will treat Flash fullscreen in the same way as HTML5 fullscreen. As an embedded widget within the browser window, the Flash fullscreen widget will become expanded to fill the entire screen during the layout process. FullscreenController itself will need only small tweaks: Just as for HTML5 fullscreen, it will be tasked to decide whether the fullscreen and mouse-lock privileges are allowed, but will instead treat Flash fullscreen mode as fully-privileged by default. Finally, WebContentsImpl will be modified to invoke the new "embedded widget" code paths for startup and shutdown (described in detail below). Use of the new code paths versus the old will be switchable via a new WebContentsDelegate method, EmbedsFullscreenWidget(). This method will declare whether the browser implements embedded Flash fullscreen and whether it is enabled/disabled via command-line flags. The control flow for entering and exiting embedded Flash fullscreen is as follows (additions/changes in red): Entering Embedded Flash Fullscreen ModeWebContentsImpl drives this process, being the delegate of the RenderViewHostImpl which receives the "show" message from the renderer. Instead of showing the window it created as a raw, fullscreened window, the behavior of ShowCreatedFullscreenWidget() changes to the following:
Exiting Embedded Flash Fullscreen ModeExiting must be considered from two possible originators. When the exit is requested by the Flash widget itself, RenderWidgetHostImpl::Shutdown() will be invoked in the browser process, which in turn calls WebContentsImpl::RenderWidgetDeleted(). From here, two steps are taken:
When the exit originates from the Browser UI (e.g., user action in the "Allow/Exit" balloon):
Other ConsiderationsWindows 8 Metro Snap mode: When entering Flash fullscreen mode, the FullscreenController will no-op. However, WebView will still receive the DidShowFullscreenWidget() notification, allowing it to correctly embed the Flash fullscreen widget within itself, all properly laid out within the Metro-Snapped browser window. Kiosk (Fullscreen App) mode: Just like Windows 8 Metro Snap mode, the FullscreenController will no-op and WebView will correctly embed the Flash fullscreen widget. Content Shell and non-Chromium applications that use src/content/ as a library: By default, the non-embed Flash fullscreen code path will be used. The key to this is the new WebContentsDelegate::EmbedsFullscreenWidget() method, whose default implementation returns false. The method is only overridden to return true for the Chromium browser on supported platforms. Work PlanPrototyping/Feasibility of Design: Completed (http://crrev.com/23656002). Implementation for Aura, Windows and Mac; disabled by default, behind feature flag: M31 (http://crrev.com/23477051). Implementation for GTK: M32 (with M31 as a stretch goal). Launch goal: Tested, UI review, and enabled by default for M32. |
Embedding Flash Fullscreen in the Browser Window的更多相关文章
- UI Framework-1: Browser Window
Browser Window The Chromium browser window is represented by several objects, some of which are incl ...
- Personalize Oracle Applications Home Page Browser Window Title
修改登录页 http://expertoracle.com/2016/03/10/personalizing-the-e-business-suite-r12-login-page/ STEP 2 : ...
- Browser Window
Window 对象 Window对象表示浏览器中打开的窗口. 如果文档包含框架(iframe或iframe标签),浏览器会被html文档创建一个window对象,并为每个框架创建一个额外的window ...
- [browser window窗口大小 算是screen补充吧]主要因为移动IE游览器 写了个兼容
先上图吧 来上代码 console.log(window.outerWidth + '--' + window.outerHeight);//只读的整数,声明了整个窗口的XY //IE 不支持此属性, ...
- Make div 100% height of browser window/设置div等于浏览器的高度
Viewport-Percentage (or Viewport-Relative) Lengths Viewport-Percentage Lengths: The viewport-percent ...
- 判断UpLoader是否安装了Flash
var flashVersion = (function() { var version; try { version ...
- 总结调用Flash的几种方法
一.Adobe 提供的方法 <object width="200" height="200" classid="clsid:D27CDB6E-A ...
- Browser security standards via access control
A computing system is operable to contain a security module within an operating system. This securit ...
- I have Flash Player installed, but I am unable to view Flash content in Chromium. How do I enable Flash Player to view this content?
I have Flash Player installed, but I am unable to view Flash content in Chromium. How do I enable Fl ...
随机推荐
- Oracle GoldenGate
Oracle GoldenGate实现数据库同步 前言:最近刚好在弄数据库同步,网上查了些资料再加上自己整理了一些,做个分享! 一.GoldenGate的安装 官方文档: Oracle®GoldenG ...
- ETL工具的功能和kettle如何来提供这些功能
不多说,直接上干货! 大家会有一个疑惑,本系列博客是Kettle,那怎么扯上ETL呢? Kettle是一款国外开源的ETL工具,纯java编写,可以在Window.Linux.Unix上运行. 说白了 ...
- Sublime使用随记
1.安装 Package Control Ctrl+` 打开命令行,执行如下代码: 适用于 Sublime Text 3: import urllib.request,os;pf='Package C ...
- PIC kit3问题
1.通过pic kit3烧录pic16F1938的时候,pic kit3自动更新了firmware,但是仍然烧录不了pic16F1938,然后再次用pic kit3烧录pic18F45k80时,一直显 ...
- 3dsMax插件开发环境配置
Windows 7 X64.3dsmax 2014 64位.3dsmax 2014 sdk.visual studio 2010: 软件下载:http://www.xy3dsmax.com/xiaza ...
- 图层Layers的介绍
图层包含的要素可以是矢量形式的也可以是栅格形式的. 这里介绍其中一种:添加TileLayer.(加载Image类型的图层) 引用:"esri/layers/TileLayer" 举 ...
- crontab执行脚本和手动执行脚本输出结果不一致的问题处理
背景:huskiesir最近用公司给分配的账户写了脚本去检测某应用状态并发送到企业邮箱,写完脚本之后去执行了一下,发现效果还不错,在邮箱显示效果如下: 10.11.116.6 检查结果OK,检查时间 ...
- 紫书 例题11-11 UVa 12661 (dihkstra变形)
这道题主要比较权值的时候要改变一下,其他地方基本一样. 比较权值的时候要考虑边的时间与a, b 可以设相对于当前边的时间now, 则now = d[u] % (a+b), 也就是当前这个边进行到整个a ...
- scratchIDE使用说明
scratchIDE使用说明
- NSURLCache、网络监測状态
有时候.对同一个URL请求多次.返回的数据可能一样的: 比方server上的某张图片.不管下载多少次,返回的数据都是一样的.可是这些情况会造成下面问题: 1,用户流量的浪费. 2.程序响应速度不够快 ...