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

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

Issue 666533007: Move JavaScriptDialogManager, JavascriptAppModalDialogViews to components/app_modal_dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 1 month 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 "components/constrained_window/constrained_window_views_client.h" 9 #include "components/constrained_window/constrained_window_views_client.h"
10 #include "components/web_modal/popup_manager.h" 10 #include "components/web_modal/popup_manager.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 content::WebContents* web_contents) { 146 content::WebContents* web_contents) {
147 DCHECK_EQ(ui::MODAL_TYPE_CHILD, dialog->GetModalType()); 147 DCHECK_EQ(ui::MODAL_TYPE_CHILD, dialog->GetModalType());
148 web_modal::PopupManager* popup_manager = 148 web_modal::PopupManager* popup_manager =
149 web_modal::PopupManager::FromWebContents(web_contents); 149 web_modal::PopupManager::FromWebContents(web_contents);
150 const gfx::NativeView parent = popup_manager->GetHostView(); 150 const gfx::NativeView parent = popup_manager->GetHostView();
151 return views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent); 151 return views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent);
152 } 152 }
153 153
154 // TODO(gbillock): Replace this with PopupManager calls. 154 // TODO(gbillock): Replace this with PopupManager calls.
155 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, 155 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
156 gfx::NativeView parent) { 156 gfx::NativeWindow parent) {
msw 2014/11/05 22:59:06 nit: fix this indent.
oshima 2014/11/05 23:22:49 reverted.
157 views::Widget* widget = 157 views::Widget* widget =
158 views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent); 158 views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent);
159 if (!dialog->UseNewStyleForThisDialog()) 159 if (!dialog->UseNewStyleForThisDialog())
160 return widget; 160 return widget;
161 DCHECK(constrained_window_views_client); 161 DCHECK(constrained_window_views_client);
162 ModalDialogHost* host = constrained_window_views_client-> 162 ModalDialogHost* host = constrained_window_views_client->
163 GetModalDialogHost(parent); 163 GetModalDialogHost(parent);
164 if (host) { 164 if (host) {
165 DCHECK_EQ(parent, host->GetHostView()); 165 DCHECK_EQ(parent, host->GetHostView());
166 ModalDialogHostObserver* dialog_host_observer = 166 ModalDialogHostObserver* dialog_host_observer =
167 new WidgetModalDialogHostObserverViews( 167 new WidgetModalDialogHostObserverViews(
168 host, widget, kWidgetModalDialogHostObserverViewsKey); 168 host, widget, kWidgetModalDialogHostObserverViewsKey);
169 dialog_host_observer->OnPositionRequiresUpdate(); 169 dialog_host_observer->OnPositionRequiresUpdate();
170 } 170 }
171 return widget; 171 return widget;
172 } 172 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698