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

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

Issue 2172363002: Created min size for print preview dialog and modified to allow the Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mac compile error. Created 4 years, 4 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 <memory> 5 #include <memory>
6 6
7 #include "components/constrained_window/constrained_window_views.h" 7 #include "components/constrained_window/constrained_window_views.h"
8 #include "components/constrained_window/native_web_contents_modal_dialog_manager _views.h" 8 #include "components/constrained_window/native_web_contents_modal_dialog_manager _views.h"
9 #include "components/web_modal/single_web_contents_dialog_manager.h" 9 #include "components/web_modal/single_web_contents_dialog_manager.h"
10 #include "components/web_modal/web_contents_modal_dialog_manager.h" 10 #include "components/web_modal/web_contents_modal_dialog_manager.h"
11 #include "content/public/browser/web_contents.h" 11 #include "content/public/browser/web_contents.h"
12 #include "ui/gfx/native_widget_types.h" 12 #include "ui/gfx/native_widget_types.h"
13 13
14 namespace constrained_window { 14 namespace constrained_window {
15 15
16 void ShowModalDialog(gfx::NativeWindow dialog, 16 void ShowModalDialog(gfx::NativeWindow dialog,
17 content::WebContents* web_contents) { 17 content::WebContents* web_contents) {
18 web_modal::WebContentsModalDialogManager* manager = 18 web_modal::WebContentsModalDialogManager* manager =
19 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents); 19 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents);
20 DCHECK(manager); 20 DCHECK(manager);
21 std::unique_ptr<web_modal::SingleWebContentsDialogManager> dialog_manager( 21 std::unique_ptr<web_modal::SingleWebContentsDialogManager> dialog_manager(
22 new constrained_window::NativeWebContentsModalDialogManagerViews( 22 new constrained_window::NativeWebContentsModalDialogManagerViews(
23 dialog, manager)); 23 dialog, manager));
24 manager->ShowDialogWithManager(dialog, std::move(dialog_manager)); 24 manager->ShowDialogWithManager(dialog, std::move(dialog_manager));
25 } 25 }
26 26
27 void ShowNonClippedModalDialog(gfx::NativeWindow dialog,
28 content::WebContents* web_contents) {
29 web_modal::WebContentsModalDialogManager* manager =
30 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents);
31 DCHECK(manager);
32 manager->AddNonClippedDialog(dialog);
33 std::unique_ptr<web_modal::SingleWebContentsDialogManager> dialog_manager(
34 new constrained_window::NativeWebContentsModalDialogManagerViews(
35 dialog, manager));
36 manager->ShowDialogWithManager(dialog, std::move(dialog_manager));
37 }
27 } // namespace constrained_window 38 } // namespace constrained_window
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698