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

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: Cleanup some leftover changes. 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())
404 m_webView->mainFrame()->stopLoading();
dcheng 2015/06/16 20:08:23 Oof. We'll need to fix this too.
nasko 2015/06/16 22:58:54 I didn't get to this one today :(. I will fix it o
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 void ChromeClientImpl::openJavaScriptAlertDelegate(LocalFrame* frame, const Stri ng& message) 412 void ChromeClientImpl::openJavaScriptAlertDelegate(LocalFrame* frame, const Stri ng& message)
412 { 413 {
413 notifyPopupOpeningObservers(); 414 notifyPopupOpeningObservers();
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 } 951 }
951 952
952 void ChromeClientImpl::notifyPopupOpeningObservers() const 953 void ChromeClientImpl::notifyPopupOpeningObservers() const
953 { 954 {
954 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers); 955 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers);
955 for (const auto& observer : observers) 956 for (const auto& observer : observers)
956 observer->willOpenPopup(); 957 observer->willOpenPopup();
957 } 958 }
958 959
959 } // namespace blink 960 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698