OLD | NEW |
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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 if (!activeDocument) | 885 if (!activeDocument) |
886 return; | 886 return; |
887 | 887 |
888 if (!activeDocument->canNavigate(m_frame)) | 888 if (!activeDocument->canNavigate(m_frame)) |
889 return; | 889 return; |
890 } | 890 } |
891 | 891 |
892 Settings* settings = m_frame->settings(); | 892 Settings* settings = m_frame->settings(); |
893 bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseW
indows(); | 893 bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseW
indows(); |
894 | 894 |
895 if (!(page->openedByDOM() || page->backForward().backForwardListCount() <= 1
|| allowScriptsToCloseWindows)) | 895 if (!(page->openedByDOM() || page->backForward().backForwardListCount() <= 1
|| allowScriptsToCloseWindows)) { |
| 896 pageConsole()->addMessage(JSMessageSource, WarningMessageLevel, "Scripts
may close only the windows that were opened by it."); |
896 return; | 897 return; |
| 898 } |
897 | 899 |
898 if (!m_frame->loader().shouldClose()) | 900 if (!m_frame->loader().shouldClose()) |
899 return; | 901 return; |
900 | 902 |
901 page->chrome().closeWindowSoon(); | 903 page->chrome().closeWindowSoon(); |
902 } | 904 } |
903 | 905 |
904 void DOMWindow::print() | 906 void DOMWindow::print() |
905 { | 907 { |
906 if (!m_frame) | 908 if (!m_frame) |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1777 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext::lifecycleN
otifier()); | 1779 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext::lifecycleN
otifier()); |
1778 } | 1780 } |
1779 | 1781 |
1780 PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier() | 1782 PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier() |
1781 { | 1783 { |
1782 return DOMWindowLifecycleNotifier::create(this); | 1784 return DOMWindowLifecycleNotifier::create(this); |
1783 } | 1785 } |
1784 | 1786 |
1785 | 1787 |
1786 } // namespace WebCore | 1788 } // namespace WebCore |
OLD | NEW |