OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
(...skipping 3037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3048 BeforeUnloadEvent* beforeUnloadEvent = BeforeUnloadEvent::create(); | 3048 BeforeUnloadEvent* beforeUnloadEvent = BeforeUnloadEvent::create(); |
3049 beforeUnloadEvent->initEvent(EventTypeNames::beforeunload, false, true); | 3049 beforeUnloadEvent->initEvent(EventTypeNames::beforeunload, false, true); |
3050 m_loadEventProgress = BeforeUnloadEventInProgress; | 3050 m_loadEventProgress = BeforeUnloadEventInProgress; |
3051 m_domWindow->dispatchEvent(beforeUnloadEvent, this); | 3051 m_domWindow->dispatchEvent(beforeUnloadEvent, this); |
3052 m_loadEventProgress = BeforeUnloadEventCompleted; | 3052 m_loadEventProgress = BeforeUnloadEventCompleted; |
3053 if (!beforeUnloadEvent->defaultPrevented()) | 3053 if (!beforeUnloadEvent->defaultPrevented()) |
3054 defaultEventHandler(beforeUnloadEvent); | 3054 defaultEventHandler(beforeUnloadEvent); |
3055 if (!frame() || beforeUnloadEvent->returnValue().isNull()) | 3055 if (!frame() || beforeUnloadEvent->returnValue().isNull()) |
3056 return true; | 3056 return true; |
3057 | 3057 |
| 3058 if (!frame()->hasReceivedUserGesture()) { |
| 3059 addConsoleMessage(ConsoleMessage::create( |
| 3060 JSMessageSource, ErrorMessageLevel, |
| 3061 "Blocked attempt to show a 'beforeunload' confirmation panel for a " |
| 3062 "frame without a user gesture.")); |
| 3063 return true; |
| 3064 } |
| 3065 |
3058 if (didAllowNavigation) { | 3066 if (didAllowNavigation) { |
3059 addConsoleMessage(ConsoleMessage::create( | 3067 addConsoleMessage(ConsoleMessage::create( |
3060 JSMessageSource, ErrorMessageLevel, | 3068 JSMessageSource, ErrorMessageLevel, |
3061 "Blocked attempt to show multiple 'beforeunload' confirmation panels " | 3069 "Blocked attempt to show multiple 'beforeunload' confirmation panels " |
3062 "for a single navigation.")); | 3070 "for a single navigation.")); |
3063 return true; | 3071 return true; |
3064 } | 3072 } |
3065 | 3073 |
3066 String text = beforeUnloadEvent->returnValue(); | 3074 String text = beforeUnloadEvent->returnValue(); |
3067 if (chromeClient.openBeforeUnloadConfirmPanel(text, m_frame, isReload)) { | 3075 if (chromeClient.openBeforeUnloadConfirmPanel(text, m_frame, isReload)) { |
(...skipping 3573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6641 } | 6649 } |
6642 | 6650 |
6643 void showLiveDocumentInstances() { | 6651 void showLiveDocumentInstances() { |
6644 WeakDocumentSet& set = liveDocumentSet(); | 6652 WeakDocumentSet& set = liveDocumentSet(); |
6645 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6653 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6646 for (blink::Document* document : set) | 6654 for (blink::Document* document : set) |
6647 fprintf(stderr, "- Document %p URL: %s\n", document, | 6655 fprintf(stderr, "- Document %p URL: %s\n", document, |
6648 document->url().getString().utf8().data()); | 6656 document->url().getString().utf8().data()); |
6649 } | 6657 } |
6650 #endif | 6658 #endif |
OLD | NEW |