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

Side by Side Diff: third_party/WebKit/WebCore/bindings/js/JSDOMWindowBase.cpp

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Harri Porten (porten@kde.org) 2 * Copyright (C) 2000 Harri Porten (porten@kde.org)
3 * Copyright (C) 2006 Jon Shier (jshier@iastate.edu) 3 * Copyright (C) 2006 Jon Shier (jshier@iastate.edu)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights resev ed. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights resev ed.
5 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public 8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 if (dialogArgs) 243 if (dialogArgs)
244 newWindow->putDirect(Identifier(exec, "dialogArguments"), dialogArgs); 244 newWindow->putDirect(Identifier(exec, "dialogArguments"), dialogArgs);
245 245
246 if (!protocolIs(url, "javascript") || newWindow->allowsAccessFrom(exec)) { 246 if (!protocolIs(url, "javascript") || newWindow->allowsAccessFrom(exec)) {
247 KURL completedURL = url.isEmpty() ? KURL("") : activeFrame->document()-> completeURL(url); 247 KURL completedURL = url.isEmpty() ? KURL("") : activeFrame->document()-> completeURL(url);
248 bool userGesture = activeFrame->script()->processingUserGesture(); 248 bool userGesture = activeFrame->script()->processingUserGesture();
249 249
250 if (created) 250 if (created)
251 newFrame->loader()->changeLocation(completedURL, activeFrame->loader ()->outgoingReferrer(), false, userGesture); 251 newFrame->loader()->changeLocation(completedURL, activeFrame->loader ()->outgoingReferrer(), false, userGesture);
252 else if (!url.isEmpty()) 252 else if (!url.isEmpty())
253 newFrame->loader()->scheduleLocationChange(completedURL.string(), ac tiveFrame->loader()->outgoingReferrer(), false, false, userGesture); 253 newFrame->loader()->scheduleLocationChange(completedURL.string(), ac tiveFrame->loader()->outgoingReferrer(), !activeFrame->script()->anyPageIsProces singUserGesture(), false, userGesture);
254 } 254 }
255 255
256 return newFrame; 256 return newFrame;
257 } 257 }
258 258
259 static bool canShowModalDialog(const Frame* frame) 259 static bool canShowModalDialog(const Frame* frame)
260 { 260 {
261 if (!frame) 261 if (!frame)
262 return false; 262 return false;
263 263
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 if (!activeFrame->loader()->shouldAllowNavigation(frame)) 783 if (!activeFrame->loader()->shouldAllowNavigation(frame))
784 return jsUndefined(); 784 return jsUndefined();
785 785
786 String completedURL; 786 String completedURL;
787 if (!urlString.isEmpty()) 787 if (!urlString.isEmpty())
788 completedURL = activeFrame->document()->completeURL(urlString).strin g(); 788 completedURL = activeFrame->document()->completeURL(urlString).strin g();
789 789
790 const JSDOMWindow* targetedWindow = toJSDOMWindow(frame); 790 const JSDOMWindow* targetedWindow = toJSDOMWindow(frame);
791 if (!completedURL.isEmpty() && (!protocolIs(completedURL, "javascript") || (targetedWindow && targetedWindow->allowsAccessFrom(exec)))) { 791 if (!completedURL.isEmpty() && (!protocolIs(completedURL, "javascript") || (targetedWindow && targetedWindow->allowsAccessFrom(exec)))) {
792 bool userGesture = activeFrame->script()->processingUserGesture(); 792 bool userGesture = activeFrame->script()->processingUserGesture();
793 frame->loader()->scheduleLocationChange(completedURL, activeFrame->l oader()->outgoingReferrer(), false, false, userGesture); 793 frame->loader()->scheduleLocationChange(completedURL, activeFrame->l oader()->outgoingReferrer(), !activeFrame->script()->anyPageIsProcessingUserGest ure(), false, userGesture);
794 } 794 }
795 return toJS(exec, frame->domWindow()); 795 return toJS(exec, frame->domWindow());
796 } 796 }
797 797
798 // In the case of a named frame or a new window, we'll use the createWindow( ) helper 798 // In the case of a named frame or a new window, we'll use the createWindow( ) helper
799 WindowFeatures windowFeatures(valueToStringWithUndefinedOrNullCheck(exec, ar gs.at(exec, 2))); 799 WindowFeatures windowFeatures(valueToStringWithUndefinedOrNullCheck(exec, ar gs.at(exec, 2)));
800 FloatRect windowRect(windowFeatures.xSet ? windowFeatures.x : 0, windowFeatu res.ySet ? windowFeatures.y : 0, 800 FloatRect windowRect(windowFeatures.xSet ? windowFeatures.x : 0, windowFeatu res.ySet ? windowFeatures.y : 0,
801 windowFeatures.widthSet ? windowFeatures.width : 0, win dowFeatures.heightSet ? windowFeatures.height : 0); 801 windowFeatures.widthSet ? windowFeatures.width : 0, win dowFeatures.heightSet ? windowFeatures.height : 0);
802 DOMWindow::adjustWindowRect(screenAvailableRect(page ? page->mainFrame()->vi ew() : 0), windowRect, windowRect); 802 DOMWindow::adjustWindowRect(screenAvailableRect(page ? page->mainFrame()->vi ew() : 0), windowRect, windowRect);
803 803
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 if (classInfo == &JSDOMWindow::s_info) 894 if (classInfo == &JSDOMWindow::s_info)
895 return static_cast<JSDOMWindow*>(asObject(value)); 895 return static_cast<JSDOMWindow*>(asObject(value));
896 if (classInfo == &JSDOMWindowShell::s_info) 896 if (classInfo == &JSDOMWindowShell::s_info)
897 return static_cast<JSDOMWindowShell*>(asObject(value))->window(); 897 return static_cast<JSDOMWindowShell*>(asObject(value))->window();
898 return 0; 898 return 0;
899 } 899 }
900 900
901 } // namespace WebCore 901 } // namespace WebCore
902 902
903 903
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698