Make USB permissions work in the new permission message system
[chromium-blink-merge.git] / content / renderer / render_widget_fullscreen.cc
blob20d4859f8b46c3f7fb9485d6d84c94c8b4509768
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/renderer/render_widget_fullscreen.h"
7 #include "content/common/view_messages.h"
8 #include "third_party/WebKit/public/web/WebWidget.h"
10 using blink::WebWidget;
12 namespace content {
14 void RenderWidgetFullscreen::show(blink::WebNavigationPolicy) {
15 DCHECK(!did_show_) << "received extraneous Show call";
16 DCHECK_NE(MSG_ROUTING_NONE, routing_id_);
17 DCHECK_NE(MSG_ROUTING_NONE, opener_id_);
19 if (!did_show_) {
20 did_show_ = true;
21 Send(new ViewHostMsg_ShowFullscreenWidget(opener_id_, routing_id_));
22 SetPendingWindowRect(initial_rect_);
26 RenderWidgetFullscreen::RenderWidgetFullscreen(
27 CompositorDependencies* compositor_deps,
28 const blink::WebScreenInfo& screen_info)
29 : RenderWidget(compositor_deps,
30 blink::WebPopupTypeNone,
31 screen_info,
32 false,
33 false,
34 false) {}
36 RenderWidgetFullscreen::~RenderWidgetFullscreen() {}
38 WebWidget* RenderWidgetFullscreen::CreateWebWidget() {
39 // TODO(boliu): Handle full screen render widgets here.
40 return RenderWidget::CreateWebWidget(this);
43 bool RenderWidgetFullscreen::Init(int32 opener_id) {
44 DCHECK(!webwidget_);
46 return RenderWidget::DoInit(opener_id, CreateWebWidget(),
47 new ViewHostMsg_CreateFullscreenWidget(
48 opener_id, &routing_id_, &surface_id_));
51 } // namespace content