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/gtk/html_dialog_gtk.h" | 5 #include "chrome/browser/ui/gtk/html_dialog_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 tab_.reset(new TabContentsWrapper( | 167 tab_.reset(new TabContentsWrapper( |
168 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL))); | 168 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL))); |
169 tab_->tab_contents()->set_delegate(this); | 169 tab_->tab_contents()->set_delegate(this); |
170 | 170 |
171 // This must be done before loading the page; see the comments in | 171 // This must be done before loading the page; see the comments in |
172 // HtmlDialogUI. | 172 // HtmlDialogUI. |
173 HtmlDialogUI::GetPropertyAccessor().SetProperty( | 173 HtmlDialogUI::GetPropertyAccessor().SetProperty( |
174 tab_->tab_contents()->property_bag(), this); | 174 tab_->tab_contents()->property_bag(), this); |
175 | 175 |
176 tab_->controller().LoadURL(GetDialogContentURL(), | 176 tab_->controller().LoadURL(GetDialogContentURL(), |
177 GURL(), content::PAGE_TRANSITION_START_PAGE, | 177 content::Referrer(), |
| 178 content::PAGE_TRANSITION_START_PAGE, |
178 std::string()); | 179 std::string()); |
179 GtkDialogFlags flags = GTK_DIALOG_NO_SEPARATOR; | 180 GtkDialogFlags flags = GTK_DIALOG_NO_SEPARATOR; |
180 if (delegate_->IsDialogModal()) | 181 if (delegate_->IsDialogModal()) |
181 flags = static_cast<GtkDialogFlags>(flags | GTK_DIALOG_MODAL); | 182 flags = static_cast<GtkDialogFlags>(flags | GTK_DIALOG_MODAL); |
182 | 183 |
183 dialog_ = gtk_dialog_new_with_buttons( | 184 dialog_ = gtk_dialog_new_with_buttons( |
184 UTF16ToUTF8(delegate_->GetDialogTitle()).c_str(), | 185 UTF16ToUTF8(delegate_->GetDialogTitle()).c_str(), |
185 parent_window_, | 186 parent_window_, |
186 flags, | 187 flags, |
187 NULL); | 188 NULL); |
(...skipping 16 matching lines...) Expand all Loading... |
204 dialog_size.height()); | 205 dialog_size.height()); |
205 | 206 |
206 gtk_widget_show_all(dialog_); | 207 gtk_widget_show_all(dialog_); |
207 | 208 |
208 return GTK_WINDOW(dialog_); | 209 return GTK_WINDOW(dialog_); |
209 } | 210 } |
210 | 211 |
211 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { | 212 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
212 OnDialogClosed(std::string()); | 213 OnDialogClosed(std::string()); |
213 } | 214 } |
OLD | NEW |