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

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

Issue 174073007: Remove deprecated window.showModalDialog() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/ChromeClientImpl.h ('k') | public/web/WebWidgetClient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 { 290 {
291 if (!m_webView->client()) 291 if (!m_webView->client())
292 return; 292 return;
293 293
294 WebNavigationPolicy policy = static_cast<WebNavigationPolicy>(navigationPoli cy); 294 WebNavigationPolicy policy = static_cast<WebNavigationPolicy>(navigationPoli cy);
295 if (policy == WebNavigationPolicyIgnore) 295 if (policy == WebNavigationPolicyIgnore)
296 policy = getNavigationPolicy(); 296 policy = getNavigationPolicy();
297 m_webView->client()->show(policy); 297 m_webView->client()->show(policy);
298 } 298 }
299 299
300 bool ChromeClientImpl::canRunModal()
301 {
302 return !!m_webView->client();
303 }
304
305 void ChromeClientImpl::runModal()
306 {
307 if (m_webView->client())
308 m_webView->client()->runModal();
309 }
310
311 void ChromeClientImpl::setToolbarsVisible(bool value) 300 void ChromeClientImpl::setToolbarsVisible(bool value)
312 { 301 {
313 m_toolbarsVisible = value; 302 m_toolbarsVisible = value;
314 } 303 }
315 304
316 bool ChromeClientImpl::toolbarsVisible() 305 bool ChromeClientImpl::toolbarsVisible()
317 { 306 {
318 return m_toolbarsVisible; 307 return m_toolbarsVisible;
319 } 308 }
320 309
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 778
790 void ChromeClientImpl::openPasswordGenerator(HTMLInputElement* input) 779 void ChromeClientImpl::openPasswordGenerator(HTMLInputElement* input)
791 { 780 {
792 ASSERT(isPasswordGenerationEnabled()); 781 ASSERT(isPasswordGenerationEnabled());
793 WebInputElement webInput(input); 782 WebInputElement webInput(input);
794 m_webView->passwordGeneratorClient()->openPasswordGenerator(webInput); 783 m_webView->passwordGeneratorClient()->openPasswordGenerator(webInput);
795 } 784 }
796 785
797 bool ChromeClientImpl::shouldRunModalDialogDuringPageDismissal(const DialogType& dialogType, const String& dialogMessage, Document::PageDismissalType dismissalT ype) const 786 bool ChromeClientImpl::shouldRunModalDialogDuringPageDismissal(const DialogType& dialogType, const String& dialogMessage, Document::PageDismissalType dismissalT ype) const
798 { 787 {
799 const char* kDialogs[] = {"alert", "confirm", "prompt", "showModalDialog"}; 788 const char* kDialogs[] = {"alert", "confirm", "prompt"};
800 int dialog = static_cast<int>(dialogType); 789 int dialog = static_cast<int>(dialogType);
801 ASSERT_WITH_SECURITY_IMPLICATION(0 <= dialog && dialog < static_cast<int>(ar raysize(kDialogs))); 790 ASSERT_WITH_SECURITY_IMPLICATION(0 <= dialog && dialog < static_cast<int>(ar raysize(kDialogs)));
802 791
803 const char* kDismissals[] = {"beforeunload", "pagehide", "unload"}; 792 const char* kDismissals[] = {"beforeunload", "pagehide", "unload"};
804 int dismissal = static_cast<int>(dismissalType) - 1; // Exclude NoDismissal. 793 int dismissal = static_cast<int>(dismissalType) - 1; // Exclude NoDismissal.
805 ASSERT_WITH_SECURITY_IMPLICATION(0 <= dismissal && dismissal < static_cast<i nt>(arraysize(kDismissals))); 794 ASSERT_WITH_SECURITY_IMPLICATION(0 <= dismissal && dismissal < static_cast<i nt>(arraysize(kDismissals)));
806 795
807 blink::Platform::current()->histogramEnumeration("Renderer.ModalDialogsDurin gPageDismissal", dismissal * arraysize(kDialogs) + dialog, arraysize(kDialogs) * arraysize(kDismissals)); 796 blink::Platform::current()->histogramEnumeration("Renderer.ModalDialogsDurin gPageDismissal", dismissal * arraysize(kDialogs) + dialog, arraysize(kDialogs) * arraysize(kDismissals));
808 797
809 String message = String("Blocked ") + kDialogs[dialog] + "('" + dialogMessag e + "') during " + kDismissals[dismissal] + "."; 798 String message = String("Blocked ") + kDialogs[dialog] + "('" + dialogMessag e + "') during " + kDismissals[dismissal] + ".";
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 { 948 {
960 return static_cast<NavigatorContentUtilsClient::CustomHandlersState>(m_webVi ew->client()->isProtocolHandlerRegistered(scheme, baseURL, url)); 949 return static_cast<NavigatorContentUtilsClient::CustomHandlersState>(m_webVi ew->client()->isProtocolHandlerRegistered(scheme, baseURL, url));
961 } 950 }
962 951
963 void NavigatorContentUtilsClientImpl::unregisterProtocolHandler(const String& sc heme, const WebCore::KURL& baseURL, const WebCore::KURL& url) 952 void NavigatorContentUtilsClientImpl::unregisterProtocolHandler(const String& sc heme, const WebCore::KURL& baseURL, const WebCore::KURL& url)
964 { 953 {
965 m_webView->client()->unregisterProtocolHandler(scheme, baseURL, url); 954 m_webView->client()->unregisterProtocolHandler(scheme, baseURL, url);
966 } 955 }
967 956
968 } // namespace blink 957 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/ChromeClientImpl.h ('k') | public/web/WebWidgetClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698