diff options
author | dcheng <dcheng@chromium.org> | 2015-10-26 16:30:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-26 23:31:41 +0000 |
commit | 3ce04b6e31fdcfe9d0cae5b4c116b57ed0dea81a (patch) | |
tree | e6f2f54c13f9cba0e7c5f841551bb104ecaee497 /extensions/browser/guest_view | |
parent | 36f66e9775081d5d950e7ba130bae0ac7ca63e71 (diff) | |
download | chromium_src-3ce04b6e31fdcfe9d0cae5b4c116b57ed0dea81a.zip chromium_src-3ce04b6e31fdcfe9d0cae5b4c116b57ed0dea81a.tar.gz chromium_src-3ce04b6e31fdcfe9d0cae5b4c116b57ed0dea81a.tar.bz2 |
Give the main frame a RenderWidget.
Currently, RenderView is a subclass of RenderWidget, and the RenderWidget
portion is effectively treated as the the widget for the main frame as
well. For a number of reasons, this is a problematic model:
- A remote frame doesn't need a widget; however, a RenderView with a remote
main frame still has a vestigal RenderWidget.
- Code that needs to affect both RenderWidget / RenderView is awkwardly
split between them, in both content and blink.
- RenderView itself is often seen as an easy entry point to perform
page-level work in the renderer. With OOPI, this is no longer a valid
assumption.
In order to incrementally de-widgetize RenderView, the main frame will
have also have a RenderWidget, to make it consistent with the local frame
roots for subframes, which already have a RenderWidget. However, instead of
giving main frames their own RenderWidget, the main frame re-uses the
RenderView as its RenderWidget.
The rationale for taking this approach is to minimize the breakage: today,
Chrome simply doesn't expect to have two "widgets" for a frame.
Instantiating a distinct RenderWidget for the main frame can confuse code
that iterates or counts the active widgets: an example of this is the
security check for injecting WebUI bindings.
In the future, when RenderViewHost has-a RenderWidgetHost (and similarly,
when RenderViewImpl has-a RenderWidget) instead of today's is-a relation,
then it be conceptually much more straightforward to transition completely
to the new model.
BUG=419087
Review URL: https://codereview.chromium.org/1303773002
Cr-Commit-Position: refs/heads/master@{#356176}
Diffstat (limited to 'extensions/browser/guest_view')
-rw-r--r-- | extensions/browser/guest_view/extension_options/extension_options_guest.cc | 5 | ||||
-rw-r--r-- | extensions/browser/guest_view/extension_options/extension_options_guest.h | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc index cfdb5cf..6a34aa0 100644 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc @@ -190,8 +190,9 @@ bool ExtensionOptionsGuest::HandleContextMenu( bool ExtensionOptionsGuest::ShouldCreateWebContents( WebContents* web_contents, - int route_id, - int main_frame_route_id, + int32_t route_id, + int32_t main_frame_route_id, + int32_t main_frame_widget_route_id, WindowContainerType window_container_type, const std::string& frame_name, const GURL& target_url, diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.h b/extensions/browser/guest_view/extension_options/extension_options_guest.h index eaab6da..922d670 100644 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.h +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.h @@ -47,8 +47,9 @@ class ExtensionOptionsGuest bool HandleContextMenu(const content::ContextMenuParams& params) final; bool ShouldCreateWebContents( content::WebContents* web_contents, - int route_id, - int main_frame_route_id, + int32_t route_id, + int32_t main_frame_route_id, + int32_t main_frame_widget_route_id, WindowContainerType window_container_type, const std::string& frame_name, const GURL& target_url, |