| 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/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/constrained_window.h" | 10 #include "chrome/browser/ui/constrained_window.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 override_tab_delegate_.reset(tab_delegate); | 38 override_tab_delegate_.reset(tab_delegate); |
| 39 web_contents->SetDelegate(tab_delegate); | 39 web_contents->SetDelegate(tab_delegate); |
| 40 } else { | 40 } else { |
| 41 web_contents->SetDelegate(this); | 41 web_contents->SetDelegate(this); |
| 42 } | 42 } |
| 43 // Set |this| as a delegate so the ConstrainedWebDialogUI can retrieve it. | 43 // Set |this| as a delegate so the ConstrainedWebDialogUI can retrieve it. |
| 44 ConstrainedWebDialogUI::SetConstrainedDelegate(web_contents, this); | 44 ConstrainedWebDialogUI::SetConstrainedDelegate(web_contents, this); |
| 45 | 45 |
| 46 web_contents->GetController().LoadURL(delegate->GetDialogContentURL(), | 46 web_contents->GetController().LoadURL(delegate->GetDialogContentURL(), |
| 47 content::Referrer(), | 47 content::Referrer(), |
| 48 content::PAGE_TRANSITION_START_PAGE, | 48 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 49 std::string()); | 49 std::string()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 ConstrainedWebDialogDelegateBase::~ConstrainedWebDialogDelegateBase() { | 52 ConstrainedWebDialogDelegateBase::~ConstrainedWebDialogDelegateBase() { |
| 53 if (release_tab_on_close_) | 53 if (release_tab_on_close_) |
| 54 ignore_result(tab_.release()); | 54 ignore_result(tab_.release()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 const WebDialogDelegate* | 57 const WebDialogDelegate* |
| 58 ConstrainedWebDialogDelegateBase::GetWebDialogDelegate() const { | 58 ConstrainedWebDialogDelegateBase::GetWebDialogDelegate() const { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 TabContents* ConstrainedWebDialogDelegateBase::tab() { | 93 TabContents* ConstrainedWebDialogDelegateBase::tab() { |
| 94 return tab_.get(); | 94 return tab_.get(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void ConstrainedWebDialogDelegateBase::HandleKeyboardEvent( | 97 void ConstrainedWebDialogDelegateBase::HandleKeyboardEvent( |
| 98 content::WebContents* source, | 98 content::WebContents* source, |
| 99 const NativeWebKeyboardEvent& event) { | 99 const NativeWebKeyboardEvent& event) { |
| 100 } | 100 } |
| OLD | NEW |