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

Side by Side Diff: components/constrained_window/show_modal_dialog_cocoa.cc

Issue 2087643003: Move web modal dialog manager files into the constrained_window component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert NativeManagerTracker split, delete CreateNativeWebModalManager impls w/ two left for Cocoa a… Created 4 years, 5 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 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698