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

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

Issue 1176843006: Move window.close implementation to DOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and move backForwardHistory to FrameClient. 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
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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 return webframe->client()->runModalBeforeUnloadDialog(isReload, message) ; 393 return webframe->client()->runModalBeforeUnloadDialog(isReload, message) ;
394 return false; 394 return false;
395 } 395 }
396 396
397 void ChromeClientImpl::closeWindowSoon() 397 void ChromeClientImpl::closeWindowSoon()
398 { 398 {
399 // Make sure this Page can no longer be found by JS. 399 // Make sure this Page can no longer be found by JS.
400 Page::ordinaryPages().remove(m_webView->page()); 400 Page::ordinaryPages().remove(m_webView->page());
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 if (m_webView->mainFrame()->isWebLocalFrame())
dcheng 2015/06/17 23:39:50 TODO this?
nasko 2015/06/19 13:23:22 Actually, the method is available on WebRemoteFram
404 m_webView->mainFrame()->stopLoading();
404 405
405 if (m_webView->client()) 406 if (m_webView->client())
406 m_webView->client()->closeWidgetSoon(); 407 m_webView->client()->closeWidgetSoon();
407 } 408 }
408 409
409 // Although a LocalFrame is passed in, we don't actually use it, since we 410 // Although a LocalFrame is passed in, we don't actually use it, since we
410 // already know our own m_webView. 411 // already know our own m_webView.
411 bool ChromeClientImpl::openJavaScriptAlertDelegate(LocalFrame* frame, const Stri ng& message) 412 bool ChromeClientImpl::openJavaScriptAlertDelegate(LocalFrame* frame, const Stri ng& message)
412 { 413 {
413 notifyPopupOpeningObservers(); 414 notifyPopupOpeningObservers();
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 } 953 }
953 954
954 void ChromeClientImpl::notifyPopupOpeningObservers() const 955 void ChromeClientImpl::notifyPopupOpeningObservers() const
955 { 956 {
956 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers); 957 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers);
957 for (const auto& observer : observers) 958 for (const auto& observer : observers)
958 observer->willOpenPopup(); 959 observer->willOpenPopup();
959 } 960 }
960 961
961 } // namespace blink 962 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698