Upstream version 10.38.220.0
[platform/framework/web/crosswalk.git] / src / components / web_modal / web_contents_modal_dialog_manager.cc
index 7ae8a2d..415926e 100644 (file)
@@ -63,14 +63,6 @@ void WebContentsModalDialogManager::FocusTopmostDialog() {
   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();
 }
@@ -106,15 +98,7 @@ WebContentsModalDialogManager::DialogState::DialogState(
     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() {}
@@ -196,14 +180,10 @@ void WebContentsModalDialogManager::WebContentsDestroyed() {
 }
 
 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