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 "chrome/browser/ui/web_contents_modal_dialog_manager.h" | 5 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
6 | 6 |
7 #include "chrome/browser/ui/web_contents_modal_dialog_manager_delegate.h" | 7 #include "chrome/browser/ui/web_contents_modal_dialog_manager_delegate.h" |
8 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" |
9 #include "content/public/browser/navigation_details.h" | 9 #include "content/public/browser/navigation_details.h" |
10 #include "content/public/browser/navigation_entry.h" | 10 #include "content/public/browser/navigation_entry.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 BlockWebContentsInteraction(false); | 126 BlockWebContentsInteraction(false); |
127 } | 127 } |
128 | 128 |
129 closing_all_dialogs_ = false; | 129 closing_all_dialogs_ = false; |
130 } | 130 } |
131 | 131 |
132 void WebContentsModalDialogManager::DidNavigateMainFrame( | 132 void WebContentsModalDialogManager::DidNavigateMainFrame( |
133 const content::LoadCommittedDetails& details, | 133 const content::LoadCommittedDetails& details, |
134 const content::FrameNavigateParams& params) { | 134 const content::FrameNavigateParams& params) { |
135 // Close constrained windows if necessary. | 135 // Close constrained windows if necessary. |
136 if (!net::RegistryControlledDomainService::SameDomainOrHost( | 136 if (!net::registry_controlled_domains::SameDomainOrHost( |
137 details.previous_url, details.entry->GetURL())) | 137 details.previous_url, details.entry->GetURL(), |
| 138 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES)) |
138 CloseAllDialogs(); | 139 CloseAllDialogs(); |
139 } | 140 } |
140 | 141 |
141 void WebContentsModalDialogManager::DidGetIgnoredUIEvent() { | 142 void WebContentsModalDialogManager::DidGetIgnoredUIEvent() { |
142 if (dialog_count()) | 143 if (dialog_count()) |
143 native_manager_->FocusDialog(*dialog_begin()); | 144 native_manager_->FocusDialog(*dialog_begin()); |
144 } | 145 } |
145 | 146 |
146 void WebContentsModalDialogManager::WebContentsDestroyed(WebContents* tab) { | 147 void WebContentsModalDialogManager::WebContentsDestroyed(WebContents* tab) { |
147 // First cleanly close all child dialogs. | 148 // First cleanly close all child dialogs. |
148 // TODO(mpcomplete): handle case if MaybeCloseChildWindows() already asked | 149 // TODO(mpcomplete): handle case if MaybeCloseChildWindows() already asked |
149 // some of these to close. CloseAllDialogs is async, so it might get called | 150 // some of these to close. CloseAllDialogs is async, so it might get called |
150 // twice before it runs. | 151 // twice before it runs. |
151 CloseAllDialogs(); | 152 CloseAllDialogs(); |
152 } | 153 } |
OLD | NEW |