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 23 matching lines...) Expand all Loading... |
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(gfx::NativeWindow dialog) { |
39 std::unique_ptr<SingleWebContentsDialogManager> mgr( | 39 std::unique_ptr<SingleWebContentsDialogManager> mgr( |
40 CreateNativeWebModalManager(dialog, this)); | 40 CreateNativeWebModalManager(dialog, this)); |
41 ShowDialogWithManager(dialog, std::move(mgr)); | 41 ShowDialogWithManager(dialog, std::move(mgr)); |
42 } | 42 } |
43 | 43 |
| 44 #if defined(OS_MACOSX) |
| 45 void WebContentsModalDialogManager::ShowModalDialogWithOverlay( |
| 46 gfx::NativeWindow dialog) { |
| 47 std::unique_ptr<SingleWebContentsDialogManager> mgr( |
| 48 CreateNativeWebModalOverlayManager(dialog, this)); |
| 49 ShowDialogWithManager(dialog, std::move(mgr)); |
| 50 } |
| 51 #endif |
| 52 |
44 // TODO(gbillock): Maybe "ShowBubbleWithManager"? | 53 // TODO(gbillock): Maybe "ShowBubbleWithManager"? |
45 void WebContentsModalDialogManager::ShowDialogWithManager( | 54 void WebContentsModalDialogManager::ShowDialogWithManager( |
46 gfx::NativeWindow dialog, | 55 gfx::NativeWindow dialog, |
47 std::unique_ptr<SingleWebContentsDialogManager> manager) { | 56 std::unique_ptr<SingleWebContentsDialogManager> manager) { |
48 if (delegate_) | 57 if (delegate_) |
49 manager->HostChanged(delegate_->GetWebContentsModalDialogHost()); | 58 manager->HostChanged(delegate_->GetWebContentsModalDialogHost()); |
50 child_dialogs_.push_back(new DialogState(dialog, std::move(manager))); | 59 child_dialogs_.push_back(new DialogState(dialog, std::move(manager))); |
51 | 60 |
52 if (child_dialogs_.size() == 1) { | 61 if (child_dialogs_.size() == 1) { |
53 BlockWebContentsInteraction(true); | 62 BlockWebContentsInteraction(true); |
(...skipping 121 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 | 184 // some of these to close. CloseAllDialogs is async, so it might get called |
176 // twice before it runs. | 185 // twice before it runs. |
177 CloseAllDialogs(); | 186 CloseAllDialogs(); |
178 } | 187 } |
179 | 188 |
180 void WebContentsModalDialogManager::DidAttachInterstitialPage() { | 189 void WebContentsModalDialogManager::DidAttachInterstitialPage() { |
181 CloseAllDialogs(); | 190 CloseAllDialogs(); |
182 } | 191 } |
183 | 192 |
184 } // namespace web_modal | 193 } // namespace web_modal |
OLD | NEW |