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

Side by Side Diff: third_party/WebKit/Source/web/ChromeClientImpl.cpp

Issue 1636873005: blink: Fix naming and const-ness of constants and non-constants. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: constants: indents Created 4 years, 11 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) 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698