OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 m_webView->closePagePopup(popup); | 842 m_webView->closePagePopup(popup); |
843 } | 843 } |
844 | 844 |
845 DOMWindow* ChromeClientImpl::pagePopupWindowForTesting() const | 845 DOMWindow* ChromeClientImpl::pagePopupWindowForTesting() const |
846 { | 846 { |
847 return m_webView->pagePopupWindow(); | 847 return m_webView->pagePopupWindow(); |
848 } | 848 } |
849 | 849 |
850 bool ChromeClientImpl::shouldOpenModalDialogDuringPageDismissal(const DialogType
& dialogType, const String& dialogMessage, Document::PageDismissalType dismissal
Type) const | 850 bool ChromeClientImpl::shouldOpenModalDialogDuringPageDismissal(const DialogType
& dialogType, const String& dialogMessage, Document::PageDismissalType dismissal
Type) const |
851 { | 851 { |
852 const char* kDialogs[] = {"alert", "confirm", "prompt"}; | 852 const char* const kDialogs[] = { "alert", "confirm", "prompt" }; |
853 int dialog = static_cast<int>(dialogType); | 853 int dialog = static_cast<int>(dialogType); |
854 ASSERT_WITH_SECURITY_IMPLICATION(0 <= dialog); | 854 ASSERT_WITH_SECURITY_IMPLICATION(0 <= dialog); |
855 ASSERT_WITH_SECURITY_IMPLICATION(dialog < static_cast<int>(WTF_ARRAY_LENGTH(
kDialogs))); | 855 ASSERT_WITH_SECURITY_IMPLICATION(dialog < static_cast<int>(WTF_ARRAY_LENGTH(
kDialogs))); |
856 | 856 |
857 const char* kDismissals[] = {"beforeunload", "pagehide", "unload"}; | 857 const char* const kDismissals[] = { "beforeunload", "pagehide", "unload" }; |
858 int dismissal = static_cast<int>(dismissalType) - 1; // Exclude NoDismissal. | 858 int dismissal = static_cast<int>(dismissalType) - 1; // Exclude NoDismissal. |
859 ASSERT_WITH_SECURITY_IMPLICATION(0 <= dismissal); | 859 ASSERT_WITH_SECURITY_IMPLICATION(0 <= dismissal); |
860 ASSERT_WITH_SECURITY_IMPLICATION(dismissal < static_cast<int>(WTF_ARRAY_LENG
TH(kDismissals))); | 860 ASSERT_WITH_SECURITY_IMPLICATION(dismissal < static_cast<int>(WTF_ARRAY_LENG
TH(kDismissals))); |
861 | 861 |
862 Platform::current()->histogramEnumeration("Renderer.ModalDialogsDuringPageDi
smissal", dismissal * WTF_ARRAY_LENGTH(kDialogs) + dialog, WTF_ARRAY_LENGTH(kDia
logs) * WTF_ARRAY_LENGTH(kDismissals)); | 862 Platform::current()->histogramEnumeration("Renderer.ModalDialogsDuringPageDi
smissal", dismissal * WTF_ARRAY_LENGTH(kDialogs) + dialog, WTF_ARRAY_LENGTH(kDia
logs) * WTF_ARRAY_LENGTH(kDismissals)); |
863 | 863 |
864 String message = String("Blocked ") + kDialogs[dialog] + "('" + dialogMessag
e + "') during " + kDismissals[dismissal] + "."; | 864 String message = String("Blocked ") + kDialogs[dialog] + "('" + dialogMessag
e + "') during " + kDismissals[dismissal] + "."; |
865 m_webView->mainFrame()->addMessageToConsole(WebConsoleMessage(WebConsoleMess
age::LevelError, message)); | 865 m_webView->mainFrame()->addMessageToConsole(WebConsoleMessage(WebConsoleMess
age::LevelError, message)); |
866 | 866 |
867 return false; | 867 return false; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 if (m_webView->pageImportanceSignals()) | 1023 if (m_webView->pageImportanceSignals()) |
1024 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); | 1024 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); |
1025 } | 1025 } |
1026 | 1026 |
1027 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler() | 1027 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler() |
1028 { | 1028 { |
1029 return m_webView->scheduler()->createFrameScheduler().release(); | 1029 return m_webView->scheduler()->createFrameScheduler().release(); |
1030 } | 1030 } |
1031 | 1031 |
1032 } // namespace blink | 1032 } // namespace blink |
OLD | NEW |