| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 #include "core/inspector/InspectorInstrumentation.h" | 76 #include "core/inspector/InspectorInstrumentation.h" |
| 77 #include "core/inspector/InspectorTraceEvents.h" | 77 #include "core/inspector/InspectorTraceEvents.h" |
| 78 #include "core/inspector/ScriptCallStack.h" | 78 #include "core/inspector/ScriptCallStack.h" |
| 79 #include "core/loader/DocumentLoader.h" | 79 #include "core/loader/DocumentLoader.h" |
| 80 #include "core/loader/FrameLoadRequest.h" | 80 #include "core/loader/FrameLoadRequest.h" |
| 81 #include "core/loader/FrameLoader.h" | 81 #include "core/loader/FrameLoader.h" |
| 82 #include "core/loader/FrameLoaderClient.h" | 82 #include "core/loader/FrameLoaderClient.h" |
| 83 #include "core/loader/MixedContentChecker.h" | 83 #include "core/loader/MixedContentChecker.h" |
| 84 #include "core/loader/SinkDocument.h" | 84 #include "core/loader/SinkDocument.h" |
| 85 #include "core/loader/appcache/ApplicationCache.h" | 85 #include "core/loader/appcache/ApplicationCache.h" |
| 86 #include "core/page/BackForwardClient.h" | |
| 87 #include "core/page/Chrome.h" | 86 #include "core/page/Chrome.h" |
| 88 #include "core/page/ChromeClient.h" | 87 #include "core/page/ChromeClient.h" |
| 89 #include "core/page/CreateWindow.h" | 88 #include "core/page/CreateWindow.h" |
| 90 #include "core/page/EventHandler.h" | 89 #include "core/page/EventHandler.h" |
| 91 #include "core/page/FrameTree.h" | 90 #include "core/page/FrameTree.h" |
| 92 #include "core/page/Page.h" | 91 #include "core/page/Page.h" |
| 93 #include "core/page/WindowFeatures.h" | 92 #include "core/page/WindowFeatures.h" |
| 94 #include "core/page/WindowFocusAllowedIndicator.h" | 93 #include "core/page/WindowFocusAllowedIndicator.h" |
| 95 #include "core/page/scrolling/ScrollingCoordinator.h" | 94 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 96 #include "core/storage/Storage.h" | 95 #include "core/storage/Storage.h" |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 if (!activeDocument) | 978 if (!activeDocument) |
| 980 return; | 979 return; |
| 981 | 980 |
| 982 if (!activeDocument->canNavigate(*m_frame)) | 981 if (!activeDocument->canNavigate(*m_frame)) |
| 983 return; | 982 return; |
| 984 } | 983 } |
| 985 | 984 |
| 986 Settings* settings = m_frame->settings(); | 985 Settings* settings = m_frame->settings(); |
| 987 bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseW
indows(); | 986 bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseW
indows(); |
| 988 | 987 |
| 989 if (!(page->openedByDOM() || page->backForward().backForwardListCount() <= 1
|| allowScriptsToCloseWindows)) { | 988 if (!page->openedByDOM() && m_frame->loader().client()->backForwardLength()
> 1 && !allowScriptsToCloseWindows) { |
| 990 frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, Warni
ngMessageLevel, "Scripts may close only the windows that were opened by it.")); | 989 frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, Warni
ngMessageLevel, "Scripts may close only the windows that were opened by it.")); |
| 991 return; | 990 return; |
| 992 } | 991 } |
| 993 | 992 |
| 994 if (!m_frame->loader().shouldClose()) | 993 if (!m_frame->loader().shouldClose()) |
| 995 return; | 994 return; |
| 996 | 995 |
| 997 InspectorInstrumentation::willCloseWindow(context); | 996 InspectorInstrumentation::willCloseWindow(context); |
| 998 | 997 |
| 999 page->chrome().closeWindowSoon(); | 998 page->chrome().closeWindowSoon(); |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1919 FrameDestructionObserver::trace(visitor); | 1918 FrameDestructionObserver::trace(visitor); |
| 1920 } | 1919 } |
| 1921 | 1920 |
| 1922 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) | 1921 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) |
| 1923 { | 1922 { |
| 1924 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. | 1923 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. |
| 1925 return v8::Handle<v8::Object>(); | 1924 return v8::Handle<v8::Object>(); |
| 1926 } | 1925 } |
| 1927 | 1926 |
| 1928 } // namespace blink | 1927 } // namespace blink |
| OLD | NEW |