| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // To make sure the default key bindings can still work, such as Escape to | 198 // To make sure the default key bindings can still work, such as Escape to |
| 199 // close the dialog. | 199 // close the dialog. |
| 200 gtk_bindings_activate_event(GTK_OBJECT(dialog_), os_event); | 200 gtk_bindings_activate_event(GTK_OBJECT(dialog_), os_event); |
| 201 } | 201 } |
| 202 | 202 |
| 203 //////////////////////////////////////////////////////////////////////////////// | 203 //////////////////////////////////////////////////////////////////////////////// |
| 204 // WebDialogGtk: | 204 // WebDialogGtk: |
| 205 | 205 |
| 206 gfx::NativeWindow WebDialogGtk::InitDialog() { | 206 gfx::NativeWindow WebDialogGtk::InitDialog() { |
| 207 tab_.reset(new TabContents(WebContents::Create( | 207 tab_.reset(new TabContents(WebContents::Create( |
| 208 browser_context(), NULL, MSG_ROUTING_NONE, NULL, NULL))); | 208 browser_context(), NULL, MSG_ROUTING_NONE, NULL))); |
| 209 tab_->web_contents()->SetDelegate(this); | 209 tab_->web_contents()->SetDelegate(this); |
| 210 | 210 |
| 211 // This must be done before loading the page; see the comments in | 211 // This must be done before loading the page; see the comments in |
| 212 // WebDialogUI. | 212 // WebDialogUI. |
| 213 WebDialogUI::GetPropertyAccessor().SetProperty( | 213 WebDialogUI::GetPropertyAccessor().SetProperty( |
| 214 tab_->web_contents()->GetPropertyBag(), this); | 214 tab_->web_contents()->GetPropertyBag(), this); |
| 215 | 215 |
| 216 tab_->web_contents()->GetController().LoadURL( | 216 tab_->web_contents()->GetController().LoadURL( |
| 217 GetDialogContentURL(), | 217 GetDialogContentURL(), |
| 218 content::Referrer(), | 218 content::Referrer(), |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 } | 255 } |
| 256 | 256 |
| 257 gtk_widget_show_all(dialog_); | 257 gtk_widget_show_all(dialog_); |
| 258 | 258 |
| 259 return GTK_WINDOW(dialog_); | 259 return GTK_WINDOW(dialog_); |
| 260 } | 260 } |
| 261 | 261 |
| 262 void WebDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { | 262 void WebDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
| 263 OnDialogClosed(std::string()); | 263 OnDialogClosed(std::string()); |
| 264 } | 264 } |
| OLD | NEW |