Give Cocoa browser windows a WebContentsModalDialogHost
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / create_native_web_modal_manager_cocoa.mm
blob5886c77f0109b8e1a6649e0d681d779963e0b981
1 // Copyright 2015 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.
5 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h"
6 #import "chrome/browser/ui/cocoa/single_web_contents_dialog_manager_cocoa.h"
7 #include "components/web_modal/web_contents_modal_dialog_manager.h"
9 namespace web_modal {
11 SingleWebContentsDialogManager*
12 WebContentsModalDialogManager::CreateNativeWebModalManager(
13     gfx::NativeWindow dialog,
14     web_modal::SingleWebContentsDialogManagerDelegate* delegate) {
15   base::scoped_nsobject<CustomConstrainedWindowSheet> sheet(
16       [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:dialog]);
17   return new SingleWebContentsDialogManagerCocoa(nullptr, sheet, delegate);
20 }  // namespace web_modal