OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_dialog_gtk.h" | 5 #include "chrome/browser/ui/gtk/web_dialog_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/property_bag.h" | 9 #include "base/property_bag.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // To make sure the default key bindings can still work, such as Escape to | 199 // To make sure the default key bindings can still work, such as Escape to |
200 // close the dialog. | 200 // close the dialog. |
201 gtk_bindings_activate_event(GTK_OBJECT(dialog_), os_event); | 201 gtk_bindings_activate_event(GTK_OBJECT(dialog_), os_event); |
202 } | 202 } |
203 | 203 |
204 //////////////////////////////////////////////////////////////////////////////// | 204 //////////////////////////////////////////////////////////////////////////////// |
205 // WebDialogGtk: | 205 // WebDialogGtk: |
206 | 206 |
207 gfx::NativeWindow WebDialogGtk::InitDialog() { | 207 gfx::NativeWindow WebDialogGtk::InitDialog() { |
208 tab_.reset(new TabContents(WebContents::Create( | 208 tab_.reset(new TabContents(WebContents::Create( |
209 browser_context(), NULL, MSG_ROUTING_NONE, NULL, NULL))); | 209 browser_context(), NULL, MSG_ROUTING_NONE, NULL))); |
210 tab_->web_contents()->SetDelegate(this); | 210 tab_->web_contents()->SetDelegate(this); |
211 | 211 |
212 // This must be done before loading the page; see the comments in | 212 // This must be done before loading the page; see the comments in |
213 // WebDialogUI. | 213 // WebDialogUI. |
214 WebDialogUI::GetPropertyAccessor().SetProperty( | 214 WebDialogUI::GetPropertyAccessor().SetProperty( |
215 tab_->web_contents()->GetPropertyBag(), this); | 215 tab_->web_contents()->GetPropertyBag(), this); |
216 | 216 |
217 tab_->web_contents()->GetController().LoadURL( | 217 tab_->web_contents()->GetController().LoadURL( |
218 GetDialogContentURL(), | 218 GetDialogContentURL(), |
219 content::Referrer(), | 219 content::Referrer(), |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 } | 256 } |
257 | 257 |
258 gtk_widget_show_all(dialog_); | 258 gtk_widget_show_all(dialog_); |
259 | 259 |
260 return GTK_WINDOW(dialog_); | 260 return GTK_WINDOW(dialog_); |
261 } | 261 } |
262 | 262 |
263 void WebDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { | 263 void WebDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
264 OnDialogClosed(std::string()); | 264 OnDialogClosed(std::string()); |
265 } | 265 } |
OLD | NEW |