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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 13649007: Browser Plugin: Simplify NewWindow code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 6240790a233b25633524cf4de8fe6533390d4934..78e1852ec24609de0325bf7997c049aaa43e378e 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -322,7 +322,8 @@ void BrowserPluginGuest::AddNewContents(WebContents* source,
const gfx::Rect& initial_pos,
bool user_gesture,
bool* was_blocked) {
- *was_blocked = false;
+ if (was_blocked)
Charlie Reis 2013/04/04 21:48:46 Any reason, or just to be clean?
Fady Samuel 2013/04/04 22:35:15 Yes, this gets called from WebContentsImpl::ShowCr
+ *was_blocked = false;
RequestNewWindowPermission(static_cast<WebContentsImpl*>(new_contents),
disposition, initial_pos, user_gesture);
}
@@ -698,7 +699,6 @@ bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) {
// renderer process paints inside.
IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup)
#endif
- IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnShowView)
IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget)
IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse)
@@ -724,13 +724,6 @@ void BrowserPluginGuest::Attach(
WebContentsViewGuest* new_view =
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
new_view->CreateViewForWidget(web_contents()->GetRenderViewHost());
-
- // Reply to ViewHostMsg_ShowView to inform the renderer that the browser has
- // processed the move. The browser may have ignored the move, but it
- // finished processing. This is used because the renderer keeps a temporary
- // cache of the widget position while these asynchronous operations are in
- // progress.
- Send(new ViewMsg_Move_ACK(web_contents()->GetRoutingID()));
}
// Once a new guest is attached to the DOM of the embedder page, then the
// lifetime of the new guest is no longer managed by the opener guest.
@@ -1084,18 +1077,6 @@ void BrowserPluginGuest::OnShowPopup(
}
#endif
-void BrowserPluginGuest::OnShowView(int route_id,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_bounds,
- bool user_gesture) {
- RenderViewHostImpl* rvh = RenderViewHostImpl::FromID(
- web_contents()->GetRenderProcessHost()->GetID(), route_id);
- WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
- WebContents::FromRenderViewHost(rvh));
- RequestNewWindowPermission(
Charlie Reis 2013/04/04 21:48:46 How does this work now?
Fady Samuel 2013/04/04 22:35:15 BrowserPluginGuest::AddNewContents handles both ca
- web_contents, disposition, initial_bounds, user_gesture);
-}
-
void BrowserPluginGuest::OnShowWidget(int route_id,
const gfx::Rect& initial_pos) {
gfx::Rect screen_pos(initial_pos);

Powered by Google App Engine
This is Rietveld 408576698