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

Side by Side Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 401523004: Break on window close when the inspector is open (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use InspectorTest.startDebuggerTest Created 6 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseW indows(); 974 bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseW indows();
975 975
976 if (!(page->openedByDOM() || page->backForward().backForwardListCount() <= 1 || allowScriptsToCloseWindows)) { 976 if (!(page->openedByDOM() || page->backForward().backForwardListCount() <= 1 || allowScriptsToCloseWindows)) {
977 frameConsole()->addMessage(JSMessageSource, WarningMessageLevel, "Script s may close only the windows that were opened by it."); 977 frameConsole()->addMessage(JSMessageSource, WarningMessageLevel, "Script s may close only the windows that were opened by it.");
978 return; 978 return;
979 } 979 }
980 980
981 if (!m_frame->loader().shouldClose()) 981 if (!m_frame->loader().shouldClose())
982 return; 982 return;
983 983
984 InspectorInstrumentation::willCloseWindow(context);
985
984 page->chrome().closeWindowSoon(); 986 page->chrome().closeWindowSoon();
985 } 987 }
986 988
987 void LocalDOMWindow::print() 989 void LocalDOMWindow::print()
988 { 990 {
989 if (!m_frame) 991 if (!m_frame)
990 return; 992 return;
991 993
992 FrameHost* host = m_frame->host(); 994 FrameHost* host = m_frame->host();
993 if (!host) 995 if (!host)
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1942 visitor->trace(m_localStorage); 1944 visitor->trace(m_localStorage);
1943 visitor->trace(m_applicationCache); 1945 visitor->trace(m_applicationCache);
1944 visitor->trace(m_performance); 1946 visitor->trace(m_performance);
1945 visitor->trace(m_css); 1947 visitor->trace(m_css);
1946 visitor->trace(m_eventQueue); 1948 visitor->trace(m_eventQueue);
1947 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor); 1949 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor);
1948 EventTargetWithInlineData::trace(visitor); 1950 EventTargetWithInlineData::trace(visitor);
1949 } 1951 }
1950 1952
1951 } // namespace WebCore 1953 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698