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

Unified Diff: Source/core/page/CreateWindow.cpp

Issue 108333006: Adding a navigation policy for the "presentation" feature in window.open() Base URL: https://github.com/drott/blink-crosswalk.git@presentationWindow
Patch Set: Created 7 years 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
« no previous file with comments | « Source/core/loader/NavigationPolicy.h ('k') | public/web/WebNavigationPolicy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/CreateWindow.cpp
diff --git a/Source/core/page/CreateWindow.cpp b/Source/core/page/CreateWindow.cpp
index 1a76d5740f7b092ad79f05452b9067862089628f..76cbce4fa76cdc4c260a246909ce9d8b534f12ef 100644
--- a/Source/core/page/CreateWindow.cpp
+++ b/Source/core/page/CreateWindow.cpp
@@ -30,6 +30,7 @@
#include "core/dom/Document.h"
#include "core/frame/Frame.h"
#include "core/loader/FrameLoadRequest.h"
+#include "core/loader/NavigationPolicy.h"
#include "core/page/Chrome.h"
#include "core/page/ChromeClient.h"
#include "core/page/Page.h"
@@ -73,7 +74,13 @@ static Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLo
if (!oldPage)
return 0;
- Page* page = oldPage->chrome().client().createWindow(openerFrame, request, features, policy, shouldSendReferrer);
+ NavigationPolicy navigationPolicy = NavigationPolicyIgnore;
+ for (size_t i = 0; i < features.additionalFeatures.size(); ++i) {
+ if (features.additionalFeatures[i].lower() == "presentation")
+ navigationPolicy = NavigationPolicyPresentationWindow;
+ }
+ Page* page = oldPage->chrome().client().createWindow(openerFrame, request, features, navigationPolicy, shouldSendReferrer);
+
if (!page)
return 0;
@@ -106,7 +113,7 @@ static Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLo
FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect);
page->chrome().setWindowRect(newWindowRect);
- page->chrome().show(policy);
+ page->chrome().show(navigationPolicy);
created = true;
return frame;
« no previous file with comments | « Source/core/loader/NavigationPolicy.h ('k') | public/web/WebNavigationPolicy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698