Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: content/renderer/render_widget_fullscreen.cc

Issue 2450353004: Move ViewHostMsg_CreateWidget to mojom (Closed)
Patch Set: Addressed @tsepez's comment Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_widget_fullscreen.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_widget_fullscreen.h" 5 #include "content/renderer/render_widget_fullscreen.h"
6 6
7 #include "content/common/view_messages.h" 7 #include "content/common/view_messages.h"
8 #include "content/renderer/render_thread_impl.h"
8 #include "third_party/WebKit/public/web/WebWidget.h" 9 #include "third_party/WebKit/public/web/WebWidget.h"
9 10
10 using blink::WebWidget; 11 using blink::WebWidget;
11 12
12 namespace content { 13 namespace content {
13 14
14 void RenderWidgetFullscreen::show(blink::WebNavigationPolicy) { 15 void RenderWidgetFullscreen::show(blink::WebNavigationPolicy) {
15 DCHECK(!did_show_) << "received extraneous Show call"; 16 DCHECK(!did_show_) << "received extraneous Show call";
16 DCHECK_NE(MSG_ROUTING_NONE, routing_id()); 17 DCHECK_NE(MSG_ROUTING_NONE, routing_id());
17 DCHECK_NE(MSG_ROUTING_NONE, opener_id_); 18 DCHECK_NE(MSG_ROUTING_NONE, opener_id_);
(...skipping 15 matching lines...) Expand all
33 false, 34 false,
34 false) {} 35 false) {}
35 36
36 RenderWidgetFullscreen::~RenderWidgetFullscreen() {} 37 RenderWidgetFullscreen::~RenderWidgetFullscreen() {}
37 38
38 WebWidget* RenderWidgetFullscreen::CreateWebWidget() { 39 WebWidget* RenderWidgetFullscreen::CreateWebWidget() {
39 // TODO(boliu): Handle full screen render widgets here. 40 // TODO(boliu): Handle full screen render widgets here.
40 return RenderWidget::CreateWebWidget(this); 41 return RenderWidget::CreateWebWidget(this);
41 } 42 }
42 43
44 bool RenderWidgetFullscreen::SendIPC(int32_t opener_id, int32_t* routing_id) {
45 return RenderThread::Get()->Send(
46 new ViewHostMsg_CreateFullscreenWidget(opener_id, routing_id));
47 }
48
43 bool RenderWidgetFullscreen::Init(int32_t opener_id) { 49 bool RenderWidgetFullscreen::Init(int32_t opener_id) {
44 DCHECK(!GetWebWidget()); 50 DCHECK(!GetWebWidget());
45 51
46 bool success = RenderWidget::DoInit( 52 bool success = RenderWidget::DoInit(
47 opener_id, CreateWebWidget(), 53 opener_id, CreateWebWidget(),
48 new ViewHostMsg_CreateFullscreenWidget(opener_id, &routing_id_)); 54 base::Bind(&RenderWidgetFullscreen::SendIPC, base::Unretained(this),
55 opener_id, &routing_id_));
56
49 if (success) { 57 if (success) {
50 // TODO(fsamuel): This is a bit ugly. The |create_widget_message| should 58 // TODO(fsamuel): This is a bit ugly. The |create_widget_message| should
51 // probably be factored out of RenderWidget::DoInit. 59 // probably be factored out of RenderWidget::DoInit.
52 SetRoutingID(routing_id_); 60 SetRoutingID(routing_id_);
53 return true; 61 return true;
54 } 62 }
55 return false; 63 return false;
56 } 64 }
57 65
58 } // namespace content 66 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_widget_fullscreen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698