summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc17
-rw-r--r--chrome/browser/renderer_host/render_view_host.h4
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h7
-rw-r--r--chrome/browser/renderer_host/render_widget_fullscreen_host.cc10
-rw-r--r--chrome/browser/renderer_host/render_widget_fullscreen_host.h15
-rw-r--r--chrome/browser/renderer_host/render_widget_helper.cc17
-rw-r--r--chrome/browser/renderer_host/render_widget_helper.h8
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view.h4
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc158
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.h8
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.h1
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.mm5
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc5
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.h1
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc8
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h3
-rw-r--r--chrome/browser/renderer_host/test/render_view_host_unittest.cc6
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.h1
18 files changed, 213 insertions, 65 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 2d0c4b2..9f1ea87 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -712,6 +712,8 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP_EX(RenderViewHost, msg, msg_is_ok)
IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnMsgShowView)
IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnMsgShowWidget)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_ShowFullscreenWidget,
+ OnMsgShowFullscreenWidget)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnMsgRunModal)
IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnMsgRenderViewReady)
IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnMsgRenderViewGone)
@@ -894,6 +896,13 @@ void RenderViewHost::CreateNewWidget(int route_id,
view->CreateNewWidget(route_id, popup_type);
}
+void RenderViewHost::CreateNewFullscreenWidget(
+ int route_id, WebKit::WebPopupType popup_type) {
+ RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
+ if (view)
+ view->CreateNewFullscreenWidget(route_id, popup_type);
+}
+
void RenderViewHost::OnMsgShowView(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
@@ -914,6 +923,14 @@ void RenderViewHost::OnMsgShowWidget(int route_id,
}
}
+void RenderViewHost::OnMsgShowFullscreenWidget(int route_id) {
+ RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
+ if (view) {
+ view->ShowCreatedFullscreenWidget(route_id);
+ Send(new ViewMsg_Move_ACK(route_id));
+ }
+}
+
void RenderViewHost::OnMsgRunModal(IPC::Message* reply_msg) {
DCHECK(!run_modal_reply_msg_);
run_modal_reply_msg_ = reply_msg;
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 65835d9..a6d99be 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -433,6 +433,9 @@ class RenderViewHost : public RenderWidgetHost {
// if this widget is a popup and what kind of popup it is (select, autofill).
void CreateNewWidget(int route_id, WebKit::WebPopupType popup_type);
+ // Creates a full screen RenderWidget.
+ void CreateNewFullscreenWidget(int route_id, WebKit::WebPopupType popup_type);
+
// Sends the response to an extension api call.
void SendExtensionResponse(int request_id, bool success,
const std::string& response,
@@ -488,6 +491,7 @@ class RenderViewHost : public RenderWidgetHost {
const gfx::Rect& initial_pos,
bool user_gesture);
void OnMsgShowWidget(int route_id, const gfx::Rect& initial_pos);
+ void OnMsgShowFullscreenWidget(int route_id);
void OnMsgRunModal(IPC::Message* reply_msg);
void OnMsgRenderViewReady();
void OnMsgRenderViewGone();
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index 13c728e..328826f 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -119,6 +119,10 @@ class RenderViewHostDelegate {
virtual void CreateNewWidget(int route_id,
WebKit::WebPopupType popup_type) = 0;
+ // Creates a full screen RenderWidget. Similar to above.
+ virtual void CreateNewFullscreenWidget(
+ int route_id, WebKit::WebPopupType popup_type) = 0;
+
// Show a previously created page with the specified disposition and bounds.
// The window is identified by the route_id passed to CreateNewWindow.
//
@@ -134,6 +138,9 @@ class RenderViewHostDelegate {
virtual void ShowCreatedWidget(int route_id,
const gfx::Rect& initial_pos) = 0;
+ // Show the newly created full screen widget. Similar to above.
+ virtual void ShowCreatedFullscreenWidget(int route_id) = 0;
+
// A context menu should be shown, to be built using the context information
// provided in the supplied params.
virtual void ShowContextMenu(const ContextMenuParams& params) = 0;
diff --git a/chrome/browser/renderer_host/render_widget_fullscreen_host.cc b/chrome/browser/renderer_host/render_widget_fullscreen_host.cc
new file mode 100644
index 0000000..c3ee786
--- /dev/null
+++ b/chrome/browser/renderer_host/render_widget_fullscreen_host.cc
@@ -0,0 +1,10 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/renderer_host/render_widget_fullscreen_host.h"
+
+RenderWidgetFullscreenHost::RenderWidgetFullscreenHost(
+ RenderProcessHost* process, int routing_id)
+ : RenderWidgetHost(process, routing_id) {
+}
diff --git a/chrome/browser/renderer_host/render_widget_fullscreen_host.h b/chrome/browser/renderer_host/render_widget_fullscreen_host.h
new file mode 100644
index 0000000..1906b4b
--- /dev/null
+++ b/chrome/browser/renderer_host/render_widget_fullscreen_host.h
@@ -0,0 +1,15 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_FULLSCREEN_HOST_H_
+#define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_FULLSCREEN_HOST_H_
+
+#include "chrome/browser/renderer_host/render_widget_host.h"
+
+class RenderWidgetFullscreenHost : public RenderWidgetHost {
+ public:
+ RenderWidgetFullscreenHost(RenderProcessHost* process, int routing_id);
+};
+
+#endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_FULLSCREEN_HOST_H_
diff --git a/chrome/browser/renderer_host/render_widget_helper.cc b/chrome/browser/renderer_host/render_widget_helper.cc
index e2cd531..c4a2542 100644
--- a/chrome/browser/renderer_host/render_widget_helper.cc
+++ b/chrome/browser/renderer_host/render_widget_helper.cc
@@ -250,6 +250,16 @@ void RenderWidgetHelper::CreateNewWidget(int opener_id,
popup_type));
}
+void RenderWidgetHelper::CreateNewFullscreenWidget(
+ int opener_id, WebKit::WebPopupType popup_type, int* route_id) {
+ *route_id = GetNextRoutingID();
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(
+ this, &RenderWidgetHelper::OnCreateFullscreenWidgetOnUI,
+ opener_id, *route_id, popup_type));
+}
+
void RenderWidgetHelper::OnCreateWidgetOnUI(
int opener_id, int route_id, WebKit::WebPopupType popup_type) {
RenderViewHost* host = RenderViewHost::FromID(render_process_id_, opener_id);
@@ -257,6 +267,13 @@ void RenderWidgetHelper::OnCreateWidgetOnUI(
host->CreateNewWidget(route_id, popup_type);
}
+void RenderWidgetHelper::OnCreateFullscreenWidgetOnUI(
+ int opener_id, int route_id, WebKit::WebPopupType popup_type) {
+ RenderViewHost* host = RenderViewHost::FromID(render_process_id_, opener_id);
+ if (host)
+ host->CreateNewFullscreenWidget(route_id, popup_type);
+}
+
#if defined(OS_MACOSX)
TransportDIB* RenderWidgetHelper::MapTransportDIB(TransportDIB::Id dib_id) {
AutoLock locked(allocated_dibs_lock_);
diff --git a/chrome/browser/renderer_host/render_widget_helper.h b/chrome/browser/renderer_host/render_widget_helper.h
index a322349..6cad1dc 100644
--- a/chrome/browser/renderer_host/render_widget_helper.h
+++ b/chrome/browser/renderer_host/render_widget_helper.h
@@ -130,6 +130,9 @@ class RenderWidgetHelper
void CreateNewWidget(int opener_id,
WebKit::WebPopupType popup_type,
int* route_id);
+ void CreateNewFullscreenWidget(int opener_id,
+ WebKit::WebPopupType popup_type,
+ int* route_id);
#if defined(OS_MACOSX)
// Called on the IO thread to handle the allocation of a TransportDIB. If
@@ -177,6 +180,11 @@ class RenderWidgetHelper
int route_id,
WebKit::WebPopupType popup_type);
+ // Called on the UI thread to create a full screen widget.
+ void OnCreateFullscreenWidgetOnUI(int opener_id,
+ int route_id,
+ WebKit::WebPopupType popup_type);
+
// Called on the IO thread to cancel resource requests for the render widget.
void OnCancelResourceRequests(int render_widget_id);
diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h
index 45192ee..8408a7d 100644
--- a/chrome/browser/renderer_host/render_widget_host_view.h
+++ b/chrome/browser/renderer_host/render_widget_host_view.h
@@ -69,6 +69,10 @@ class RenderWidgetHostView {
virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) = 0;
+ // Perform all the initialization steps necessary for this object to represent
+ // a full screen window.
+ virtual void InitAsFullscreen(RenderWidgetHostView* parent_host_view) = 0;
+
// Returns the associated RenderWidgetHost.
virtual RenderWidgetHost* GetRenderWidgetHost() const = 0;
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index 2b4b6d5..88292f0 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -512,72 +512,12 @@ void RenderWidgetHostViewGtk::InitAsChild() {
void RenderWidgetHostViewGtk::InitAsPopup(
RenderWidgetHostView* parent_host_view, const gfx::Rect& pos) {
- parent_host_view_ = parent_host_view;
- parent_ = parent_host_view->GetNativeView();
- GtkWidget* popup = gtk_window_new(GTK_WINDOW_POPUP);
- view_.Own(RenderWidgetHostViewGtkWidget::CreateNewWidget(this));
- // |im_context_| must be created after creating |view_| widget.
- im_context_.reset(new GtkIMContextWrapper(this));
- // |key_bindings_handler_| must be created after creating |view_| widget.
- key_bindings_handler_.reset(new GtkKeyBindingsHandler(view_.get()));
- plugin_container_manager_.set_host_widget(view_.get());
-
-#if defined(OS_CHROMEOS)
- tooltip_window_.reset(new views::TooltipWindowGtk(view_.get()));
-#endif // defined(OS_CHROMEOS)
-
- gtk_container_add(GTK_CONTAINER(popup), view_.get());
-
- requested_size_ = gfx::Size(std::min(pos.width(), kMaxWindowWidth),
- std::min(pos.height(), kMaxWindowHeight));
- host_->WasResized();
- gtk_widget_set_size_request(view_.get(), requested_size_.width(),
- requested_size_.height());
-
- gtk_window_set_default_size(GTK_WINDOW(popup), -1, -1);
- // Don't allow the window to be resized. This also forces the window to
- // shrink down to the size of its child contents.
- gtk_window_set_resizable(GTK_WINDOW(popup), FALSE);
- gtk_window_move(GTK_WINDOW(popup), pos.x(), pos.y());
- gtk_widget_show_all(popup);
-
- // If we are not activatable, we don't want to grab keyboard input,
- // and webkit will manage our destruction.
- // For unknown reason, calling gtk_grab_add() before realizing the widget may
- // cause an assertion failure. See http://crbug.com/51834. So we do it after
- // showing the popup.
- if (NeedsInputGrab()) {
- // Grab all input for the app. If a click lands outside the bounds of the
- // popup, WebKit will notice and destroy us. Before doing this we need
- // to ensure that the the popup is added to the browser's window group,
- // to allow for the grabs to work correctly.
- gtk_window_group_add_window(gtk_window_get_group(
- GTK_WINDOW(gtk_widget_get_toplevel(parent_))), GTK_WINDOW(popup));
- gtk_grab_add(view_.get());
-
- // We need for the application to do an X grab as well. However if the app
- // already has an X grab (as in the case of extension popup), an app grab
- // will suffice.
- do_x_grab_ = !gdk_pointer_is_grabbed();
-
- // Now grab all of X's input.
- if (do_x_grab_) {
- gdk_pointer_grab(
- parent_->window,
- TRUE, // Only events outside of the window are reported with respect
- // to |parent_->window|.
- static_cast<GdkEventMask>(GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK),
- NULL,
- NULL,
- GDK_CURRENT_TIME);
- // We grab keyboard events too so things like alt+tab are eaten.
- gdk_keyboard_grab(parent_->window, TRUE, GDK_CURRENT_TIME);
- }
- }
+ DoInitAsPopup(parent_host_view, GTK_WINDOW_POPUP, pos, false);
+}
- // TODO(brettw) possibly enable out-of-process painting here as well
- // (see InitAsChild).
+void RenderWidgetHostViewGtk::InitAsFullscreen(
+ RenderWidgetHostView* parent_host_view) {
+ DoInitAsPopup(parent_host_view, GTK_WINDOW_TOPLEVEL, gfx::Rect(), true);
}
void RenderWidgetHostViewGtk::DidBecomeSelected() {
@@ -1035,6 +975,94 @@ void RenderWidgetHostViewGtk::ShowCurrentCursor() {
gdk_cursor_unref(gdk_cursor);
}
+void RenderWidgetHostViewGtk::DoInitAsPopup(
+ RenderWidgetHostView* parent_host_view,
+ GtkWindowType window_type,
+ const gfx::Rect& pos,
+ bool is_fullscreen) {
+ // If we are not a popup, then popup will be leaked.
+ DCHECK(IsPopup());
+
+ parent_host_view_ = parent_host_view;
+ parent_ = parent_host_view->GetNativeView();
+ GtkWidget* popup = gtk_window_new(window_type);
+ gtk_window_set_decorated(GTK_WINDOW(popup), FALSE);
+ view_.Own(RenderWidgetHostViewGtkWidget::CreateNewWidget(this));
+ // |im_context_| must be created after creating |view_| widget.
+ im_context_.reset(new GtkIMContextWrapper(this));
+ // |key_bindings_handler_| must be created after creating |view_| widget.
+ key_bindings_handler_.reset(new GtkKeyBindingsHandler(view_.get()));
+ plugin_container_manager_.set_host_widget(view_.get());
+
+#if defined(OS_CHROMEOS)
+ tooltip_window_.reset(new views::TooltipWindowGtk(view_.get()));
+#endif // defined(OS_CHROMEOS)
+
+ gtk_container_add(GTK_CONTAINER(popup), view_.get());
+
+ if (is_fullscreen) {
+ // Set the request size to the size of the screen.
+ // TODO(boliu): Make sure this works for multi-monitor set ups and move this
+ // to some utility function.
+ GdkScreen* screen = gtk_window_get_screen(GTK_WINDOW(popup));
+ requested_size_ = gfx::Size(
+ std::min(gdk_screen_get_width(screen), kMaxWindowWidth),
+ std::min(gdk_screen_get_height(screen), kMaxWindowHeight));
+ } else {
+ requested_size_ = gfx::Size(std::min(pos.width(), kMaxWindowWidth),
+ std::min(pos.height(), kMaxWindowHeight));
+ }
+ host_->WasResized();
+
+ gtk_widget_set_size_request(view_.get(), requested_size_.width(),
+ requested_size_.height());
+ // Don't allow the window to be resized. This also forces the window to
+ // shrink down to the size of its child contents.
+ gtk_window_set_resizable(GTK_WINDOW(popup), FALSE);
+ gtk_window_set_default_size(GTK_WINDOW(popup), -1, -1);
+ gtk_window_move(GTK_WINDOW(popup), pos.x(), pos.y());
+ if (is_fullscreen) {
+ gtk_window_fullscreen(GTK_WINDOW(popup));
+ }
+
+ gtk_widget_show_all(popup);
+
+ // If we are not activatable, we don't want to grab keyboard input,
+ // and webkit will manage our destruction.
+ // For unknown reason, calling gtk_grab_add() before realizing the widget may
+ // cause an assertion failure. See http://crbug.com/51834. So we do it after
+ // showing the popup.
+ if (NeedsInputGrab()) {
+ // Grab all input for the app. If a click lands outside the bounds of the
+ // popup, WebKit will notice and destroy us. Before doing this we need
+ // to ensure that the the popup is added to the browser's window group,
+ // to allow for the grabs to work correctly.
+ gtk_window_group_add_window(gtk_window_get_group(
+ GTK_WINDOW(gtk_widget_get_toplevel(parent_))), GTK_WINDOW(popup));
+ gtk_grab_add(view_.get());
+
+ // We need for the application to do an X grab as well. However if the app
+ // already has an X grab (as in the case of extension popup), an app grab
+ // will suffice.
+ do_x_grab_ = !gdk_pointer_is_grabbed();
+
+ // Now grab all of X's input.
+ if (do_x_grab_) {
+ gdk_pointer_grab(
+ parent_->window,
+ TRUE, // Only events outside of the window are reported with respect
+ // to |parent_->window|.
+ static_cast<GdkEventMask>(GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK),
+ NULL,
+ NULL,
+ GDK_CURRENT_TIME);
+ // We grab keyboard events too so things like alt+tab are eaten.
+ gdk_keyboard_grab(parent_->window, TRUE, GDK_CURRENT_TIME);
+ }
+ }
+}
+
void RenderWidgetHostViewGtk::CreatePluginContainer(
gfx::PluginWindowHandle id) {
plugin_container_manager_.CreatePluginContainer(id);
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.h b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
index d8d29fe..099da46 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
@@ -52,6 +52,7 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView {
// RenderWidgetHostView implementation.
virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos);
+ virtual void InitAsFullscreen(RenderWidgetHostView* parent_host_view);
virtual RenderWidgetHost* GetRenderWidgetHost() const { return host_; }
virtual void DidBecomeSelected();
virtual void WasHidden();
@@ -124,6 +125,13 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView {
// Update the display cursor for the render view.
void ShowCurrentCursor();
+ // Helper method for InitAsPopup() and InitAsFullscreen().
+ void DoInitAsPopup(
+ RenderWidgetHostView* parent_host_view,
+ GtkWindowType window_type,
+ const gfx::Rect& pos, // Ignored if is_fullscreen is true.
+ bool is_fullscreen);
+
// The model object.
RenderWidgetHost* host_;
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/chrome/browser/renderer_host/render_widget_host_view_mac.h
index d3e87dd1c..f223928 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.h
@@ -173,6 +173,7 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView {
// Implementation of RenderWidgetHostView:
virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos);
+ virtual void InitAsFullscreen(RenderWidgetHostView* parent_host_view);
virtual RenderWidgetHost* GetRenderWidgetHost() const;
virtual void DidBecomeSelected();
virtual void WasHidden();
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
index 355e039..49d653a 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -352,6 +352,11 @@ void RenderWidgetHostViewMac::InitAsPopup(
[cocoa_view_ setFrame:initial_frame];
}
+void RenderWidgetHostViewMac::InitAsFullscreen(
+ RenderWidgetHostView* parent_host_view) {
+ NOTIMPLEMENTED() << "Full screen not implemented on Mac";
+}
+
RenderWidgetHost* RenderWidgetHostViewMac::GetRenderWidgetHost() const {
return render_widget_host_;
}
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index b25d83d..ac1be0b 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -332,6 +332,11 @@ void RenderWidgetHostViewWin::InitAsPopup(
ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA);
}
+void RenderWidgetHostViewWin::InitAsFullscreen(
+ RenderWidgetHostView* parent_host_view) {
+ NOTIMPLEMENTED() << "Fullscreen not implemented on Win";
+}
+
RenderWidgetHost* RenderWidgetHostViewWin::GetRenderWidgetHost() const {
return render_widget_host_;
}
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h
index ff6228a..a177f00 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.h
@@ -120,6 +120,7 @@ class RenderWidgetHostViewWin
// Implementation of RenderWidgetHostView:
virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos);
+ virtual void InitAsFullscreen(RenderWidgetHostView* parent_host_view);
virtual RenderWidgetHost* GetRenderWidgetHost() const;
virtual void DidBecomeSelected();
virtual void WasHidden();
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index d7a740c..8a70211 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -367,6 +367,8 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWindow, OnMsgCreateWindow)
IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWidget, OnMsgCreateWidget)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_CreateFullscreenWidget,
+ OnMsgCreateFullscreenWidget)
IPC_MESSAGE_HANDLER(ViewHostMsg_SetCookie, OnSetCookie)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetCookies, OnGetCookies)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetRawCookies,
@@ -566,6 +568,12 @@ void ResourceMessageFilter::OnMsgCreateWidget(int opener_id,
render_widget_helper_->CreateNewWidget(opener_id, popup_type, route_id);
}
+void ResourceMessageFilter::OnMsgCreateFullscreenWidget(
+ int opener_id, WebKit::WebPopupType popup_type, int* route_id) {
+ render_widget_helper_->CreateNewFullscreenWidget(
+ opener_id, popup_type, route_id);
+}
+
void ResourceMessageFilter::OnSetCookie(const IPC::Message& message,
const GURL& url,
const GURL& first_party_for_cookies,
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index cc180c6..cc1a15f 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -142,6 +142,9 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
void OnMsgCreateWidget(int opener_id,
WebKit::WebPopupType popup_type,
int* route_id);
+ void OnMsgCreateFullscreenWidget(int opener_id,
+ WebKit::WebPopupType popup_type,
+ int* route_id);
void OnSetCookie(const IPC::Message& message,
const GURL& url,
const GURL& first_party_for_cookies,
diff --git a/chrome/browser/renderer_host/test/render_view_host_unittest.cc b/chrome/browser/renderer_host/test/render_view_host_unittest.cc
index c281d63..c6d46d6 100644
--- a/chrome/browser/renderer_host/test/render_view_host_unittest.cc
+++ b/chrome/browser/renderer_host/test/render_view_host_unittest.cc
@@ -17,6 +17,12 @@ TEST_F(RenderViewHostTest, FilterAbout) {
EXPECT_EQ(GURL("about:blank"), controller().GetActiveEntry()->url());
}
+// Create a full screen popup RenderWidgetHost and View.
+TEST_F(RenderViewHostTest, CreateFullscreenWidget) {
+ int routing_id = process()->GetNextRoutingID();
+ rvh()->CreateNewFullscreenWidget(routing_id, WebKit::WebPopupTypeNone);
+}
+
// The test that follow trigger DCHECKS in debug build.
#if defined(NDEBUG)
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.h b/chrome/browser/renderer_host/test/test_render_view_host.h
index 86887d6..765a790 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.h
+++ b/chrome/browser/renderer_host/test/test_render_view_host.h
@@ -45,6 +45,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) {}
+ virtual void InitAsFullscreen(RenderWidgetHostView* parent_host_view) {}
virtual RenderWidgetHost* GetRenderWidgetHost() const { return NULL; }
virtual void DidBecomeSelected() {}
virtual void WasHidden() {}