| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 9 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
| 10 #include "content/public/browser/navigation_details.h" | 10 #include "content/public/browser/navigation_details.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 WebContentsModalDialogManagerDelegate* d) { | 28 WebContentsModalDialogManagerDelegate* d) { |
| 29 delegate_ = d; | 29 delegate_ = d; |
| 30 | 30 |
| 31 for (WebContentsModalDialogList::iterator it = child_dialogs_.begin(); | 31 for (WebContentsModalDialogList::iterator it = child_dialogs_.begin(); |
| 32 it != child_dialogs_.end(); it++) { | 32 it != child_dialogs_.end(); it++) { |
| 33 // Delegate can be NULL on Views/Win32 during tab drag. | 33 // Delegate can be NULL on Views/Win32 during tab drag. |
| 34 (*it)->manager->HostChanged(d ? d->GetWebContentsModalDialogHost() : NULL); | 34 (*it)->manager->HostChanged(d ? d->GetWebContentsModalDialogHost() : NULL); |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 void WebContentsModalDialogManager::ShowModalDialog(gfx::NativeWindow dialog) { | 38 void WebContentsModalDialogManager::ShowModalDialog( |
| 39 gfx::NativeWindow dialog, bool* independent_bounds, |
| 40 const char * kHasIndependentBoundsKey) { |
| 39 std::unique_ptr<SingleWebContentsDialogManager> mgr( | 41 std::unique_ptr<SingleWebContentsDialogManager> mgr( |
| 40 CreateNativeWebModalManager(dialog, this)); | 42 CreateNativeWebModalManager(dialog, this, independent_bounds, |
| 43 kHasIndependentBoundsKey)); |
| 41 ShowDialogWithManager(dialog, std::move(mgr)); | 44 ShowDialogWithManager(dialog, std::move(mgr)); |
| 42 } | 45 } |
| 43 | 46 |
| 44 // TODO(gbillock): Maybe "ShowBubbleWithManager"? | 47 // TODO(gbillock): Maybe "ShowBubbleWithManager"? |
| 45 void WebContentsModalDialogManager::ShowDialogWithManager( | 48 void WebContentsModalDialogManager::ShowDialogWithManager( |
| 46 gfx::NativeWindow dialog, | 49 gfx::NativeWindow dialog, |
| 47 std::unique_ptr<SingleWebContentsDialogManager> manager) { | 50 std::unique_ptr<SingleWebContentsDialogManager> manager) { |
| 48 if (delegate_) | 51 if (delegate_) |
| 49 manager->HostChanged(delegate_->GetWebContentsModalDialogHost()); | 52 manager->HostChanged(delegate_->GetWebContentsModalDialogHost()); |
| 50 child_dialogs_.push_back(new DialogState(dialog, std::move(manager))); | 53 child_dialogs_.push_back(new DialogState(dialog, std::move(manager))); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // some of these to close. CloseAllDialogs is async, so it might get called | 178 // some of these to close. CloseAllDialogs is async, so it might get called |
| 176 // twice before it runs. | 179 // twice before it runs. |
| 177 CloseAllDialogs(); | 180 CloseAllDialogs(); |
| 178 } | 181 } |
| 179 | 182 |
| 180 void WebContentsModalDialogManager::DidAttachInterstitialPage() { | 183 void WebContentsModalDialogManager::DidAttachInterstitialPage() { |
| 181 CloseAllDialogs(); | 184 CloseAllDialogs(); |
| 182 } | 185 } |
| 183 | 186 |
| 184 } // namespace web_modal | 187 } // namespace web_modal |
| OLD | NEW |