| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 tab_.reset(new TabContentsWrapper( | 159 tab_.reset(new TabContentsWrapper( |
| 160 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL))); | 160 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL))); |
| 161 tab_->tab_contents()->set_delegate(this); | 161 tab_->tab_contents()->set_delegate(this); |
| 162 | 162 |
| 163 // This must be done before loading the page; see the comments in | 163 // This must be done before loading the page; see the comments in |
| 164 // HtmlDialogUI. | 164 // HtmlDialogUI. |
| 165 HtmlDialogUI::GetPropertyAccessor().SetProperty( | 165 HtmlDialogUI::GetPropertyAccessor().SetProperty( |
| 166 tab_->tab_contents()->property_bag(), this); | 166 tab_->tab_contents()->property_bag(), this); |
| 167 | 167 |
| 168 tab_->controller().LoadURL(GetDialogContentURL(), | 168 tab_->controller().LoadURL(GetDialogContentURL(), |
| 169 GURL(), PageTransition::START_PAGE, std::string()); | 169 GURL(), content::PAGE_TRANSITION_START_PAGE, |
| 170 std::string()); |
| 170 GtkDialogFlags flags = GTK_DIALOG_NO_SEPARATOR; | 171 GtkDialogFlags flags = GTK_DIALOG_NO_SEPARATOR; |
| 171 if (delegate_->IsDialogModal()) | 172 if (delegate_->IsDialogModal()) |
| 172 flags = static_cast<GtkDialogFlags>(flags | GTK_DIALOG_MODAL); | 173 flags = static_cast<GtkDialogFlags>(flags | GTK_DIALOG_MODAL); |
| 173 | 174 |
| 174 dialog_ = gtk_dialog_new_with_buttons( | 175 dialog_ = gtk_dialog_new_with_buttons( |
| 175 UTF16ToUTF8(delegate_->GetDialogTitle()).c_str(), | 176 UTF16ToUTF8(delegate_->GetDialogTitle()).c_str(), |
| 176 parent_window_, | 177 parent_window_, |
| 177 flags, | 178 flags, |
| 178 NULL); | 179 NULL); |
| 179 | 180 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 195 dialog_size.height()); | 196 dialog_size.height()); |
| 196 | 197 |
| 197 gtk_widget_show_all(dialog_); | 198 gtk_widget_show_all(dialog_); |
| 198 | 199 |
| 199 return GTK_WINDOW(dialog_); | 200 return GTK_WINDOW(dialog_); |
| 200 } | 201 } |
| 201 | 202 |
| 202 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { | 203 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
| 203 OnDialogClosed(std::string()); | 204 OnDialogClosed(std::string()); |
| 204 } | 205 } |
| OLD | NEW |