| 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 "components/web_modal/web_contents_modal_dialog_manager.h" | 5 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 6 | 6 |
| 7 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 7 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
| 8 #include "content/public/browser/navigation_details.h" | 8 #include "content/public/browser/navigation_details.h" |
| 9 #include "content/public/browser/navigation_entry.h" | 9 #include "content/public/browser/navigation_entry.h" |
| 10 #include "content/public/browser/notification_details.h" | 10 #include "content/public/browser/notification_details.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 native_manager_->ManageDialog(dialog); | 39 native_manager_->ManageDialog(dialog); |
| 40 | 40 |
| 41 if (child_dialogs_.size() == 1) { | 41 if (child_dialogs_.size() == 1) { |
| 42 if (delegate_ && delegate_->IsWebContentsVisible(web_contents())) | 42 if (delegate_ && delegate_->IsWebContentsVisible(web_contents())) |
| 43 native_manager_->ShowDialog(dialog); | 43 native_manager_->ShowDialog(dialog); |
| 44 BlockWebContentsInteraction(true); | 44 BlockWebContentsInteraction(true); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool WebContentsModalDialogManager::IsShowingDialog() const { | 48 bool WebContentsModalDialogManager::IsDialogActive() const { |
| 49 return !child_dialogs_.empty(); | 49 return !child_dialogs_.empty(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void WebContentsModalDialogManager::FocusTopmostDialog() { | 52 void WebContentsModalDialogManager::FocusTopmostDialog() { |
| 53 DCHECK(!child_dialogs_.empty()); | 53 DCHECK(!child_dialogs_.empty()); |
| 54 native_manager_->FocusDialog(child_dialogs_.front().dialog); | 54 native_manager_->FocusDialog(child_dialogs_.front().dialog); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void WebContentsModalDialogManager::SetCloseOnInterstitialWebUI( | 57 void WebContentsModalDialogManager::SetCloseOnInterstitialWebUI( |
| 58 NativeWebContentsModalDialog dialog, | 58 NativeWebContentsModalDialog dialog, |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // list. | 182 // list. |
| 183 WebContentsModalDialogList dialogs(child_dialogs_); | 183 WebContentsModalDialogList dialogs(child_dialogs_); |
| 184 for (WebContentsModalDialogList::iterator it = dialogs.begin(); | 184 for (WebContentsModalDialogList::iterator it = dialogs.begin(); |
| 185 it != dialogs.end(); ++it) { | 185 it != dialogs.end(); ++it) { |
| 186 if (it->close_on_interstitial_webui) | 186 if (it->close_on_interstitial_webui) |
| 187 native_manager_->CloseDialog(it->dialog); | 187 native_manager_->CloseDialog(it->dialog); |
| 188 } | 188 } |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace web_modal | 191 } // namespace web_modal |
| OLD | NEW |