Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/constrained_window/constrained_window_views.h" | |
| 6 | |
| 7 #include <memory> | |
| 8 | |
| 9 #include "components/web_modal/single_web_contents_dialog_manager.h" | |
| 10 #include "components/web_modal/web_contents_modal_dialog_manager.h" | |
| 11 #include "content/public/browser/web_contents.h" | |
| 12 #include "ui/gfx/native_widget_types.h" | |
| 13 | |
| 14 // TODO(patricialor): This is a layering violation and should be deleted. | |
| 15 // Currently it's needed because on Cocoa, the dialog needs to be shown with a | |
| 16 // SingleWebContentsDialogManagerViewsMac, which depends on things inside | |
| 17 // chrome/browser/ui/cocoa/constrained_window/* and thus can't be moved out into | |
| 18 // components/constrained_window/*. | |
|
tapted
2016/07/19 09:29:41
add something like "For this to work at all, Creat
Patti Lor
2016/07/28 01:29:31
Done.
| |
| 19 | |
| 20 namespace constrained_window { | |
| 21 | |
| 22 void ShowModalDialog(gfx::NativeWindow dialog, | |
| 23 content::WebContents* initiator_web_contents) { | |
| 24 web_modal::WebContentsModalDialogManager* manager = | |
| 25 web_modal::WebContentsModalDialogManager::FromWebContents( | |
| 26 initiator_web_contents); | |
| 27 std::unique_ptr<web_modal::SingleWebContentsDialogManager> dialog_manager( | |
| 28 web_modal::WebContentsModalDialogManager::CreateNativeWebModalManager( | |
| 29 dialog, manager)); | |
| 30 manager->ShowDialogWithManager(dialog, std::move(dialog_manager)); | |
| 31 } | |
| 32 | |
| 33 } // namespace constrained_window | |
| OLD | NEW |