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

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

Issue 1180843006: [DevTools] Add dialog type and return value to Page.javascriptDialog{Opening,Closed}. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: frontend Created 5 years, 6 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') | no next file » | 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 401
402 // Make sure that all loading is stopped. Ensures that JS stops executing! 402 // Make sure that all loading is stopped. Ensures that JS stops executing!
403 m_webView->mainFrame()->stopLoading(); 403 m_webView->mainFrame()->stopLoading();
404 404
405 if (m_webView->client()) 405 if (m_webView->client())
406 m_webView->client()->closeWidgetSoon(); 406 m_webView->client()->closeWidgetSoon();
407 } 407 }
408 408
409 // Although a LocalFrame is passed in, we don't actually use it, since we 409 // Although a LocalFrame is passed in, we don't actually use it, since we
410 // already know our own m_webView. 410 // already know our own m_webView.
411 void ChromeClientImpl::openJavaScriptAlertDelegate(LocalFrame* frame, const Stri ng& message) 411 bool ChromeClientImpl::openJavaScriptAlertDelegate(LocalFrame* frame, const Stri ng& message)
412 { 412 {
413 notifyPopupOpeningObservers(); 413 notifyPopupOpeningObservers();
414 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); 414 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
415 if (webframe->client()) { 415 if (webframe->client()) {
416 if (WebUserGestureIndicator::isProcessingUserGesture()) 416 if (WebUserGestureIndicator::isProcessingUserGesture())
417 WebUserGestureIndicator::currentUserGestureToken().setJavascriptProm pt(); 417 WebUserGestureIndicator::currentUserGestureToken().setJavascriptProm pt();
418 webframe->client()->runModalAlertDialog(message); 418 webframe->client()->runModalAlertDialog(message);
419 return true;
419 } 420 }
421 return false;
420 } 422 }
421 423
422 // See comments for openJavaScriptAlertDelegate(). 424 // See comments for openJavaScriptAlertDelegate().
423 bool ChromeClientImpl::openJavaScriptConfirmDelegate(LocalFrame* frame, const St ring& message) 425 bool ChromeClientImpl::openJavaScriptConfirmDelegate(LocalFrame* frame, const St ring& message)
424 { 426 {
425 notifyPopupOpeningObservers(); 427 notifyPopupOpeningObservers();
426 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); 428 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
427 if (webframe->client()) { 429 if (webframe->client()) {
428 if (WebUserGestureIndicator::isProcessingUserGesture()) 430 if (WebUserGestureIndicator::isProcessingUserGesture())
429 WebUserGestureIndicator::currentUserGestureToken().setJavascriptProm pt(); 431 WebUserGestureIndicator::currentUserGestureToken().setJavascriptProm pt();
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 } 952 }
951 953
952 void ChromeClientImpl::notifyPopupOpeningObservers() const 954 void ChromeClientImpl::notifyPopupOpeningObservers() const
953 { 955 {
954 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers); 956 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers);
955 for (const auto& observer : observers) 957 for (const auto& observer : observers)
956 observer->willOpenPopup(); 958 observer->willOpenPopup();
957 } 959 }
958 960
959 } // namespace blink 961 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/ChromeClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698