| 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 "base/property_bag.h" | 9 #include "base/property_bag.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 Profile* profile, | 26 Profile* profile, |
| 27 WebDialogDelegate* delegate, | 27 WebDialogDelegate* delegate, |
| 28 WebDialogWebContentsDelegate* tab_delegate) | 28 WebDialogWebContentsDelegate* tab_delegate) |
| 29 : WebDialogWebContentsDelegate(profile, new ChromeWebContentsHandler), | 29 : WebDialogWebContentsDelegate(profile, new ChromeWebContentsHandler), |
| 30 web_dialog_delegate_(delegate), | 30 web_dialog_delegate_(delegate), |
| 31 window_(NULL), | 31 window_(NULL), |
| 32 closed_via_webui_(false), | 32 closed_via_webui_(false), |
| 33 release_tab_on_close_(false) { | 33 release_tab_on_close_(false) { |
| 34 CHECK(delegate); | 34 CHECK(delegate); |
| 35 WebContents* web_contents = | 35 WebContents* web_contents = |
| 36 WebContents::Create(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); | 36 WebContents::Create(profile, NULL, MSG_ROUTING_NONE, NULL); |
| 37 tab_.reset(new TabContents(web_contents)); | 37 tab_.reset(new TabContents(web_contents)); |
| 38 if (tab_delegate) { | 38 if (tab_delegate) { |
| 39 override_tab_delegate_.reset(tab_delegate); | 39 override_tab_delegate_.reset(tab_delegate); |
| 40 web_contents->SetDelegate(tab_delegate); | 40 web_contents->SetDelegate(tab_delegate); |
| 41 } else { | 41 } else { |
| 42 web_contents->SetDelegate(this); | 42 web_contents->SetDelegate(this); |
| 43 } | 43 } |
| 44 // Set |this| as a property so the ConstrainedWebDialogUI can retrieve it. | 44 // Set |this| as a property so the ConstrainedWebDialogUI can retrieve it. |
| 45 ConstrainedWebDialogUI::GetPropertyAccessor().SetProperty( | 45 ConstrainedWebDialogUI::GetPropertyAccessor().SetProperty( |
| 46 web_contents->GetPropertyBag(), this); | 46 web_contents->GetPropertyBag(), this); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return window_; | 92 return window_; |
| 93 } | 93 } |
| 94 | 94 |
| 95 TabContents* ConstrainedWebDialogDelegateBase::tab() { | 95 TabContents* ConstrainedWebDialogDelegateBase::tab() { |
| 96 return tab_.get(); | 96 return tab_.get(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ConstrainedWebDialogDelegateBase::HandleKeyboardEvent( | 99 void ConstrainedWebDialogDelegateBase::HandleKeyboardEvent( |
| 100 const NativeWebKeyboardEvent& event) { | 100 const NativeWebKeyboardEvent& event) { |
| 101 } | 101 } |
| OLD | NEW |