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/tab_contents/tab_contents_wrapper.h" |
10 #include "chrome/browser/ui/views/constrained_window_views.h" | 10 #include "chrome/browser/ui/views/constrained_window_views.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 CHECK(delegate); | 109 CHECK(delegate); |
110 TabContents* tab_contents = | 110 TabContents* tab_contents = |
111 new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); | 111 new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); |
112 html_tab_contents_.reset(new TabContentsWrapper(tab_contents)); | 112 html_tab_contents_.reset(new TabContentsWrapper(tab_contents)); |
113 tab_contents->set_delegate(this); | 113 tab_contents->set_delegate(this); |
114 | 114 |
115 // Set |this| as a property so the ConstrainedHtmlUI can retrieve it. | 115 // Set |this| as a property so the ConstrainedHtmlUI can retrieve it. |
116 ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( | 116 ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( |
117 html_tab_contents_->tab_contents()->property_bag(), this); | 117 html_tab_contents_->tab_contents()->property_bag(), this); |
118 tab_contents->controller().LoadURL(delegate->GetDialogContentURL(), | 118 tab_contents->controller().LoadURL(delegate->GetDialogContentURL(), |
119 GURL(), | 119 content::Referrer(), |
120 content::PAGE_TRANSITION_START_PAGE, | 120 content::PAGE_TRANSITION_START_PAGE, |
121 std::string()); | 121 std::string()); |
122 } | 122 } |
123 | 123 |
124 ConstrainedHtmlDelegateViews::~ConstrainedHtmlDelegateViews() { | 124 ConstrainedHtmlDelegateViews::~ConstrainedHtmlDelegateViews() { |
125 if (release_tab_on_close_) | 125 if (release_tab_on_close_) |
126 ignore_result(html_tab_contents_.release()); | 126 ignore_result(html_tab_contents_.release()); |
127 } | 127 } |
128 | 128 |
129 HtmlDialogUIDelegate* ConstrainedHtmlDelegateViews::GetHtmlDialogUIDelegate() { | 129 HtmlDialogUIDelegate* ConstrainedHtmlDelegateViews::GetHtmlDialogUIDelegate() { |
(...skipping 14 matching lines...) Expand all Loading... |
144 Profile* profile, | 144 Profile* profile, |
145 HtmlDialogUIDelegate* delegate, | 145 HtmlDialogUIDelegate* delegate, |
146 TabContentsWrapper* container) { | 146 TabContentsWrapper* container) { |
147 ConstrainedHtmlDelegateViews* constrained_delegate = | 147 ConstrainedHtmlDelegateViews* constrained_delegate = |
148 new ConstrainedHtmlDelegateViews(profile, delegate); | 148 new ConstrainedHtmlDelegateViews(profile, delegate); |
149 ConstrainedWindow* constrained_window = | 149 ConstrainedWindow* constrained_window = |
150 new ConstrainedWindowViews(container, constrained_delegate); | 150 new ConstrainedWindowViews(container, constrained_delegate); |
151 constrained_delegate->set_window(constrained_window); | 151 constrained_delegate->set_window(constrained_window); |
152 return constrained_delegate; | 152 return constrained_delegate; |
153 } | 153 } |
OLD | NEW |