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

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

Issue 1779383002: MacViews: Remove constrained window dependencies for certificate viewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep a reference to the sheet window in single_web_contents_dialog_manager_cocoa.mm. Created 4 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/constrained_window/constrained_window_views.h" 5 #include "components/constrained_window/constrained_window_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 views::Widget* ShowWebModalDialogViews( 135 views::Widget* ShowWebModalDialogViews(
136 views::WidgetDelegate* dialog, 136 views::WidgetDelegate* dialog,
137 content::WebContents* initiator_web_contents) { 137 content::WebContents* initiator_web_contents) {
138 DCHECK(constrained_window_views_client); 138 DCHECK(constrained_window_views_client);
139 // For embedded WebContents, use the embedder's WebContents for constrained 139 // For embedded WebContents, use the embedder's WebContents for constrained
140 // window. 140 // window.
141 content::WebContents* web_contents = 141 content::WebContents* web_contents =
142 guest_view::GuestViewBase::GetTopLevelWebContents(initiator_web_contents); 142 guest_view::GuestViewBase::GetTopLevelWebContents(initiator_web_contents);
143 views::Widget* widget = CreateWebModalDialogViews(dialog, web_contents); 143 views::Widget* widget = CreateWebModalDialogViews(dialog, web_contents);
144 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents) 144 web_modal::WebContentsModalDialogManager* manager =
145 ->ShowModalDialog(widget->GetNativeWindow()); 145 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents);
146 manager->ShowModalDialog(widget->GetNativeWindow());
146 return widget; 147 return widget;
147 } 148 }
148 149
149 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, 150 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog,
150 content::WebContents* web_contents) { 151 content::WebContents* web_contents) {
151 DCHECK_EQ(ui::MODAL_TYPE_CHILD, dialog->GetModalType()); 152 DCHECK_EQ(ui::MODAL_TYPE_CHILD, dialog->GetModalType());
152 return views::DialogDelegate::CreateDialogWidget( 153 return views::DialogDelegate::CreateDialogWidget(
153 dialog, nullptr, 154 dialog, nullptr,
154 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents) 155 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents)
155 ->delegate() 156 ->delegate()
(...skipping 29 matching lines...) Expand all
185 if (host) { 186 if (host) {
186 DCHECK_EQ(parent_view, host->GetHostView()); 187 DCHECK_EQ(parent_view, host->GetHostView());
187 ModalDialogHostObserver* dialog_host_observer = 188 ModalDialogHostObserver* dialog_host_observer =
188 new WidgetModalDialogHostObserverViews( 189 new WidgetModalDialogHostObserverViews(
189 host, widget, kWidgetModalDialogHostObserverViewsKey); 190 host, widget, kWidgetModalDialogHostObserverViewsKey);
190 dialog_host_observer->OnPositionRequiresUpdate(); 191 dialog_host_observer->OnPositionRequiresUpdate();
191 } 192 }
192 return widget; 193 return widget;
193 } 194 }
194 195
195 } // namespace constrained window 196 } // namespace constrained_window
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698