| OLD | NEW |
| 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 "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" | 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "components/web_modal/web_contents_modal_dialog_host.h" | 8 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 9 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 9 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 } | 198 } |
| 199 | 199 |
| 200 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( | 200 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( |
| 201 content::BrowserContext* browser_context, | 201 content::BrowserContext* browser_context, |
| 202 WebDialogDelegate* delegate, | 202 WebDialogDelegate* delegate, |
| 203 WebDialogWebContentsDelegate* tab_delegate, | 203 WebDialogWebContentsDelegate* tab_delegate, |
| 204 content::WebContents* web_contents) { | 204 content::WebContents* web_contents) { |
| 205 ConstrainedWebDialogDelegateViewViews* constrained_delegate = | 205 ConstrainedWebDialogDelegateViewViews* constrained_delegate = |
| 206 new ConstrainedWebDialogDelegateViewViews( | 206 new ConstrainedWebDialogDelegateViewViews( |
| 207 browser_context, delegate, tab_delegate); | 207 browser_context, delegate, tab_delegate); |
| 208 // TODO(gbillock): Use PopupManager here. |
| 208 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 209 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 209 WebContentsModalDialogManager::FromWebContents(web_contents); | 210 WebContentsModalDialogManager::FromWebContents(web_contents); |
| 210 WebContentsModalDialogManagerDelegate* modal_delegate = | 211 WebContentsModalDialogManagerDelegate* modal_delegate = |
| 211 web_contents_modal_dialog_manager->delegate(); | 212 web_contents_modal_dialog_manager->delegate(); |
| 212 DCHECK(modal_delegate); | 213 DCHECK(modal_delegate); |
| 213 views::Widget* window = views::Widget::CreateWindowAsFramelessChild( | 214 views::Widget* window = views::Widget::CreateWindowAsFramelessChild( |
| 214 constrained_delegate, | 215 constrained_delegate, |
| 215 modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); | 216 modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); |
| 216 web_contents_modal_dialog_manager->ShowModalDialog( | 217 web_contents_modal_dialog_manager->ShowModalDialog( |
| 217 window->GetNativeView()); | 218 window->GetNativeView()); |
| 218 constrained_delegate->SetWindow(window); | 219 constrained_delegate->SetWindow(window); |
| 219 return constrained_delegate; | 220 return constrained_delegate; |
| 220 } | 221 } |
| OLD | NEW |