| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_html_ui.h" | 5 #include "chrome/browser/ui/webui/constrained_html_ui.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 9 #include "chrome/browser/ui/views/constrained_window_views.h" | 10 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 10 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" | 11 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" |
| 11 #include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h" | 12 #include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h" |
| 12 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 13 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
| 13 #include "content/browser/tab_contents/tab_contents.h" | 14 #include "content/browser/tab_contents/tab_contents.h" |
| 14 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
| 15 #include "views/view.h" | 16 #include "views/view.h" |
| 16 #include "views/widget/widget_delegate.h" | 17 #include "views/widget/widget_delegate.h" |
| 17 | 18 |
| 18 class ConstrainedHtmlDelegateViews : public TabContentsContainer, | 19 class ConstrainedHtmlDelegateViews : public TabContentsContainer, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 113 |
| 113 void ConstrainedHtmlDelegateViews::OnDialogCloseFromWebUI() { | 114 void ConstrainedHtmlDelegateViews::OnDialogCloseFromWebUI() { |
| 114 closed_via_webui_ = true; | 115 closed_via_webui_ = true; |
| 115 window_->CloseConstrainedWindow(); | 116 window_->CloseConstrainedWindow(); |
| 116 } | 117 } |
| 117 | 118 |
| 118 // static | 119 // static |
| 119 ConstrainedWindow* ConstrainedHtmlUI::CreateConstrainedHtmlDialog( | 120 ConstrainedWindow* ConstrainedHtmlUI::CreateConstrainedHtmlDialog( |
| 120 Profile* profile, | 121 Profile* profile, |
| 121 HtmlDialogUIDelegate* delegate, | 122 HtmlDialogUIDelegate* delegate, |
| 122 TabContents* container) { | 123 TabContentsWrapper* container) { |
| 123 ConstrainedHtmlDelegateViews* constrained_delegate = | 124 ConstrainedHtmlDelegateViews* constrained_delegate = |
| 124 new ConstrainedHtmlDelegateViews(profile, delegate); | 125 new ConstrainedHtmlDelegateViews(profile, delegate); |
| 125 ConstrainedWindow* constrained_window = | 126 ConstrainedWindow* constrained_window = |
| 126 new ConstrainedWindowViews(container, constrained_delegate); | 127 new ConstrainedWindowViews(container->tab_contents(), |
| 128 constrained_delegate); |
| 127 constrained_delegate->set_window(constrained_window); | 129 constrained_delegate->set_window(constrained_window); |
| 128 return constrained_window; | 130 return constrained_window; |
| 129 } | 131 } |
| OLD | NEW |