| 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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/browser_dialogs.h" | 10 #include "chrome/browser/ui/browser_dialogs.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 //////////////////////////////////////////////////////////////////////////////// | 187 //////////////////////////////////////////////////////////////////////////////// |
| 188 // content::WebContentsDelegate implementation: | 188 // content::WebContentsDelegate implementation: |
| 189 | 189 |
| 190 // A simplified version of BrowserWindowGtk::HandleKeyboardEvent(). | 190 // A simplified version of BrowserWindowGtk::HandleKeyboardEvent(). |
| 191 // We don't handle global keyboard shortcuts here, but that's fine since | 191 // We don't handle global keyboard shortcuts here, but that's fine since |
| 192 // they're all browser-specific. (This may change in the future.) | 192 // they're all browser-specific. (This may change in the future.) |
| 193 void WebDialogGtk::HandleKeyboardEvent(content::WebContents* source, | 193 void WebDialogGtk::HandleKeyboardEvent(content::WebContents* source, |
| 194 const NativeWebKeyboardEvent& event) { | 194 const NativeWebKeyboardEvent& event) { |
| 195 GdkEventKey* os_event = &event.os_event->key; | 195 GdkEventKey* os_event = &event.os_event->key; |
| 196 if (!os_event || event.type == WebKit::WebInputEvent::Char) | 196 if (!os_event || event.type == blink::WebInputEvent::Char) |
| 197 return; | 197 return; |
| 198 | 198 |
| 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 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 gtk_widget_show_all(dialog_); | 255 gtk_widget_show_all(dialog_); |
| 256 | 256 |
| 257 web_contents_->GetView()->SetInitialFocus(); | 257 web_contents_->GetView()->SetInitialFocus(); |
| 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 |