| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 4758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4769 if (is_showing_before_unload_dialog_ && !success) { | 4769 if (is_showing_before_unload_dialog_ && !success) { |
| 4770 // It is possible for the current RenderFrameHost to have changed in the | 4770 // It is possible for the current RenderFrameHost to have changed in the |
| 4771 // meantime. Do not reset the navigation state in that case. | 4771 // meantime. Do not reset the navigation state in that case. |
| 4772 if (rfh && rfh == rfh->frame_tree_node()->current_frame_host()) { | 4772 if (rfh && rfh == rfh->frame_tree_node()->current_frame_host()) { |
| 4773 rfh->frame_tree_node()->BeforeUnloadCanceled(); | 4773 rfh->frame_tree_node()->BeforeUnloadCanceled(); |
| 4774 controller_.DiscardNonCommittedEntries(); | 4774 controller_.DiscardNonCommittedEntries(); |
| 4775 } | 4775 } |
| 4776 | 4776 |
| 4777 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 4777 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 4778 BeforeUnloadDialogCancelled()); | 4778 BeforeUnloadDialogCancelled()); |
| 4779 |
| 4780 // Notification for UI updates in response to the changed navigation state. |
| 4781 NotifyNavigationStateChanged(INVALIDATE_TYPE_LOAD); |
| 4779 } | 4782 } |
| 4780 | 4783 |
| 4781 is_showing_before_unload_dialog_ = false; | 4784 is_showing_before_unload_dialog_ = false; |
| 4782 if (rfh) { | 4785 if (rfh) { |
| 4783 rfh->JavaScriptDialogClosed(reply_msg, success, user_input, | 4786 rfh->JavaScriptDialogClosed(reply_msg, success, user_input, |
| 4784 dialog_was_suppressed); | 4787 dialog_was_suppressed); |
| 4785 } else { | 4788 } else { |
| 4786 // Don't leak the sync IPC reply if the RFH or process is gone. | 4789 // Don't leak the sync IPC reply if the RFH or process is gone. |
| 4787 delete reply_msg; | 4790 delete reply_msg; |
| 4788 } | 4791 } |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4965 for (RenderViewHost* render_view_host : render_view_host_set) | 4968 for (RenderViewHost* render_view_host : render_view_host_set) |
| 4966 render_view_host->OnWebkitPreferencesChanged(); | 4969 render_view_host->OnWebkitPreferencesChanged(); |
| 4967 } | 4970 } |
| 4968 | 4971 |
| 4969 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 4972 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
| 4970 JavaScriptDialogManager* dialog_manager) { | 4973 JavaScriptDialogManager* dialog_manager) { |
| 4971 dialog_manager_ = dialog_manager; | 4974 dialog_manager_ = dialog_manager; |
| 4972 } | 4975 } |
| 4973 | 4976 |
| 4974 } // namespace content | 4977 } // namespace content |
| OLD | NEW |