| 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/views/constrained_window_views.h" | 8 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 9 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | 9 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 10 #include "chrome/browser/ui/web_contents_modal_dialog_manager_delegate.h" | 10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
| 11 #include "content/public/browser/native_web_keyboard_event.h" | 11 #include "content/public/browser/native_web_keyboard_event.h" |
| 12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
| 13 #include "content/public/browser/web_contents_view.h" | 13 #include "content/public/browser/web_contents_view.h" |
| 14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
| 15 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" | 15 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" |
| 16 #include "ui/views/controls/webview/webview.h" | 16 #include "ui/views/controls/webview/webview.h" |
| 17 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
| 18 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
| 19 #include "ui/views/widget/widget_delegate.h" | 19 #include "ui/views/widget/widget_delegate.h" |
| 20 #include "ui/views/window/dialog_delegate.h" | 20 #include "ui/views/window/dialog_delegate.h" |
| 21 #include "ui/web_dialogs/web_dialog_delegate.h" | 21 #include "ui/web_dialogs/web_dialog_delegate.h" |
| 22 #include "ui/web_dialogs/web_dialog_ui.h" | 22 #include "ui/web_dialogs/web_dialog_ui.h" |
| 23 | 23 |
| 24 using content::WebContents; | 24 using content::WebContents; |
| 25 using ui::WebDialogDelegate; | 25 using ui::WebDialogDelegate; |
| 26 using ui::WebDialogWebContentsDelegate; | 26 using ui::WebDialogWebContentsDelegate; |
| 27 using web_modal::NativeWebContentsModalDialog; |
| 28 using web_modal::WebContentsModalDialogManager; |
| 27 | 29 |
| 28 namespace { | 30 namespace { |
| 29 | 31 |
| 30 class ConstrainedWebDialogDelegateViews | 32 class ConstrainedWebDialogDelegateViews |
| 31 : public ConstrainedWebDialogDelegateBase { | 33 : public ConstrainedWebDialogDelegateBase { |
| 32 public: | 34 public: |
| 33 ConstrainedWebDialogDelegateViews( | 35 ConstrainedWebDialogDelegateViews( |
| 34 content::BrowserContext* browser_context, | 36 content::BrowserContext* browser_context, |
| 35 WebDialogDelegate* delegate, | 37 WebDialogDelegate* delegate, |
| 36 WebDialogWebContentsDelegate* tab_delegate, | 38 WebDialogWebContentsDelegate* tab_delegate, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 WebContentsModalDialogManager::FromWebContents(web_contents); | 226 WebContentsModalDialogManager::FromWebContents(web_contents); |
| 225 views::Widget* window = CreateWebContentsModalDialogViews( | 227 views::Widget* window = CreateWebContentsModalDialogViews( |
| 226 constrained_delegate, | 228 constrained_delegate, |
| 227 web_contents->GetView()->GetNativeView(), | 229 web_contents->GetView()->GetNativeView(), |
| 228 web_contents_modal_dialog_manager->delegate()-> | 230 web_contents_modal_dialog_manager->delegate()-> |
| 229 GetWebContentsModalDialogHost()); | 231 GetWebContentsModalDialogHost()); |
| 230 web_contents_modal_dialog_manager->ShowDialog(window->GetNativeView()); | 232 web_contents_modal_dialog_manager->ShowDialog(window->GetNativeView()); |
| 231 constrained_delegate->SetWindow(window); | 233 constrained_delegate->SetWindow(window); |
| 232 return constrained_delegate; | 234 return constrained_delegate; |
| 233 } | 235 } |
| OLD | NEW |