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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 gfx::NativeWindow HtmlDialogGtk::InitDialog() { | 172 gfx::NativeWindow HtmlDialogGtk::InitDialog() { |
173 tab_.reset(new TabContentsWrapper( | 173 tab_.reset(new TabContentsWrapper( |
174 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL))); | 174 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL))); |
175 tab_->tab_contents()->set_delegate(this); | 175 tab_->tab_contents()->set_delegate(this); |
176 | 176 |
177 // This must be done before loading the page; see the comments in | 177 // This must be done before loading the page; see the comments in |
178 // HtmlDialogUI. | 178 // HtmlDialogUI. |
179 HtmlDialogUI::GetPropertyAccessor().SetProperty( | 179 HtmlDialogUI::GetPropertyAccessor().SetProperty( |
180 tab_->tab_contents()->property_bag(), this); | 180 tab_->tab_contents()->property_bag(), this); |
181 | 181 |
182 tab_->controller().LoadURL(GetDialogContentURL(), | 182 tab_->tab_contents()->controller().LoadURL( |
183 content::Referrer(), | 183 GetDialogContentURL(), |
184 content::PAGE_TRANSITION_START_PAGE, | 184 content::Referrer(), |
185 std::string()); | 185 content::PAGE_TRANSITION_START_PAGE, |
| 186 std::string()); |
186 GtkDialogFlags flags = GTK_DIALOG_NO_SEPARATOR; | 187 GtkDialogFlags flags = GTK_DIALOG_NO_SEPARATOR; |
187 if (delegate_->IsDialogModal()) | 188 if (delegate_->IsDialogModal()) |
188 flags = static_cast<GtkDialogFlags>(flags | GTK_DIALOG_MODAL); | 189 flags = static_cast<GtkDialogFlags>(flags | GTK_DIALOG_MODAL); |
189 | 190 |
190 dialog_ = gtk_dialog_new_with_buttons( | 191 dialog_ = gtk_dialog_new_with_buttons( |
191 UTF16ToUTF8(delegate_->GetDialogTitle()).c_str(), | 192 UTF16ToUTF8(delegate_->GetDialogTitle()).c_str(), |
192 parent_window_, | 193 parent_window_, |
193 flags, | 194 flags, |
194 NULL); | 195 NULL); |
195 | 196 |
(...skipping 15 matching lines...) Expand all Loading... |
211 dialog_size.height()); | 212 dialog_size.height()); |
212 | 213 |
213 gtk_widget_show_all(dialog_); | 214 gtk_widget_show_all(dialog_); |
214 | 215 |
215 return GTK_WINDOW(dialog_); | 216 return GTK_WINDOW(dialog_); |
216 } | 217 } |
217 | 218 |
218 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { | 219 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
219 OnDialogClosed(std::string()); | 220 OnDialogClosed(std::string()); |
220 } | 221 } |
OLD | NEW |