child_dialogs_.front()->manager->Focus();
}
-void WebContentsModalDialogManager::SetCloseOnInterstitialPage(
- NativeWebContentsModalDialog dialog,
- bool close) {
- WebContentsModalDialogList::iterator loc = FindDialogState(dialog);
- DCHECK(loc != child_dialogs_.end());
- (*loc)->close_on_interstitial_webui = close;
-}
-
content::WebContents* WebContentsModalDialogManager::GetWebContents() const {
return web_contents();
}
NativeWebContentsModalDialog dialog,
scoped_ptr<SingleWebContentsDialogManager> mgr)
: dialog(dialog),
- manager(mgr.release()),
-#if defined(USE_AURA)
- close_on_interstitial_webui(true)
-#else
- // TODO(wittman): Test that closing on interstitial webui works properly
- // on Mac and use the true default for all platforms.
- close_on_interstitial_webui(false)
-#endif
- {
+ manager(mgr.release()) {
}
WebContentsModalDialogManager::DialogState::~DialogState() {}
}
void WebContentsModalDialogManager::DidAttachInterstitialPage() {
- // Copy the dialogs so we can close and remove them while iterating over the
- // list.
- WebContentsModalDialogList dialogs(child_dialogs_);
- for (WebContentsModalDialogList::iterator it = dialogs.begin();
- it != dialogs.end(); ++it) {
- if ((*it)->close_on_interstitial_webui)
- (*it)->manager->Close();
- }
+ // TODO(wittman): Test closing on interstitial webui works properly on Mac.
+#if defined(USE_AURA)
+ CloseAllDialogs();
+#endif
}
} // namespace web_modal