Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: chrome/browser/ui/cocoa/modal_dialog_client_cocoa.mm

Issue 866263008: MacViews: Unify web contents modal dialog types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ValidationMessageBubble
Patch Set: Fixes for tapted Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #import "chrome/browser/ui/cocoa/modal_dialog_client_cocoa.h"
6
7 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h"
8 #import "chrome/browser/ui/cocoa/single_web_contents_dialog_manager_cocoa.h"
9 #include "components/web_modal/web_contents_modal_dialog_manager.h"
10
11 using web_modal::WebContentsModalDialogManager;
12
13 ModalDialogClientCocoa::ModalDialogClientCocoa() : manager_(nullptr) {
14 }
15
16 ModalDialogClientCocoa::~ModalDialogClientCocoa() {
17 DCHECK(!manager_);
18 }
19
20 void ModalDialogClientCocoa::Show(id<ConstrainedWindowSheet> sheet,
21 content::WebContents* web_contents) {
22 auto manager = WebContentsModalDialogManager::FromWebContents(web_contents);
23 scoped_ptr<SingleWebContentsDialogManagerCocoa> native_manager(
24 new SingleWebContentsDialogManagerCocoa(this, sheet, manager));
25 manager->ShowDialogWithManager([sheet sheetWindow], native_manager.Pass());
26 }
27
28 void ModalDialogClientCocoa::Close() {
29 if (manager_)
30 manager_->Close();
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698