| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/ui/constrained_window.h" | 9 #include "chrome/browser/ui/web_contents_modal_dialog.h" |
| 10 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" | 10 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" |
| 11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
| 13 #include "ui/web_dialogs/web_dialog_delegate.h" | 13 #include "ui/web_dialogs/web_dialog_delegate.h" |
| 14 #include "ui/web_dialogs/web_dialog_ui.h" | 14 #include "ui/web_dialogs/web_dialog_ui.h" |
| 15 | 15 |
| 16 using content::NativeWebKeyboardEvent; | 16 using content::NativeWebKeyboardEvent; |
| 17 using content::WebContents; | 17 using content::WebContents; |
| 18 using ui::WebDialogDelegate; | 18 using ui::WebDialogDelegate; |
| 19 using ui::WebDialogWebContentsDelegate; | 19 using ui::WebDialogWebContentsDelegate; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 return web_dialog_delegate_.get(); | 56 return web_dialog_delegate_.get(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 WebDialogDelegate* | 59 WebDialogDelegate* |
| 60 ConstrainedWebDialogDelegateBase::GetWebDialogDelegate() { | 60 ConstrainedWebDialogDelegateBase::GetWebDialogDelegate() { |
| 61 return web_dialog_delegate_.get(); | 61 return web_dialog_delegate_.get(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void ConstrainedWebDialogDelegateBase::OnDialogCloseFromWebUI() { | 64 void ConstrainedWebDialogDelegateBase::OnDialogCloseFromWebUI() { |
| 65 closed_via_webui_ = true; | 65 closed_via_webui_ = true; |
| 66 window_->CloseConstrainedWindow(); | 66 window_->CloseWebContentsModalDialog(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void ConstrainedWebDialogDelegateBase::set_window(ConstrainedWindow* window) { | 69 void ConstrainedWebDialogDelegateBase::set_window( |
| 70 WebContentsModalDialog* window) { |
| 70 window_ = window; | 71 window_ = window; |
| 71 } | 72 } |
| 72 | 73 |
| 73 void ConstrainedWebDialogDelegateBase::set_override_tab_delegate( | 74 void ConstrainedWebDialogDelegateBase::set_override_tab_delegate( |
| 74 WebDialogWebContentsDelegate* override_tab_delegate) { | 75 WebDialogWebContentsDelegate* override_tab_delegate) { |
| 75 override_tab_delegate_.reset(override_tab_delegate); | 76 override_tab_delegate_.reset(override_tab_delegate); |
| 76 } | 77 } |
| 77 | 78 |
| 78 bool ConstrainedWebDialogDelegateBase::closed_via_webui() const { | 79 bool ConstrainedWebDialogDelegateBase::closed_via_webui() const { |
| 79 return closed_via_webui_; | 80 return closed_via_webui_; |
| 80 } | 81 } |
| 81 | 82 |
| 82 void ConstrainedWebDialogDelegateBase::ReleaseWebContentsOnDialogClose() { | 83 void ConstrainedWebDialogDelegateBase::ReleaseWebContentsOnDialogClose() { |
| 83 release_contents_on_close_ = true; | 84 release_contents_on_close_ = true; |
| 84 } | 85 } |
| 85 | 86 |
| 86 ConstrainedWindow* ConstrainedWebDialogDelegateBase::GetWindow() { | 87 WebContentsModalDialog* ConstrainedWebDialogDelegateBase::GetWindow() { |
| 87 return window_; | 88 return window_; |
| 88 } | 89 } |
| 89 | 90 |
| 90 WebContents* ConstrainedWebDialogDelegateBase::GetWebContents() { | 91 WebContents* ConstrainedWebDialogDelegateBase::GetWebContents() { |
| 91 return web_contents_.get(); | 92 return web_contents_.get(); |
| 92 } | 93 } |
| 93 | 94 |
| 94 void ConstrainedWebDialogDelegateBase::HandleKeyboardEvent( | 95 void ConstrainedWebDialogDelegateBase::HandleKeyboardEvent( |
| 95 content::WebContents* source, | 96 content::WebContents* source, |
| 96 const NativeWebKeyboardEvent& event) { | 97 const NativeWebKeyboardEvent& event) { |
| 97 } | 98 } |
| OLD | NEW |