| 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/views/html_dialog_view.h" | 5 #include "chrome/browser/ui/views/html_dialog_view.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/browser_dialogs.h" | 10 #include "chrome/browser/ui/browser_dialogs.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void HtmlDialogView::MoveContents(TabContents* source, const gfx::Rect& pos) { | 200 void HtmlDialogView::MoveContents(TabContents* source, const gfx::Rect& pos) { |
| 201 // The contained web page wishes to resize itself. We let it do this because | 201 // The contained web page wishes to resize itself. We let it do this because |
| 202 // if it's a dialog we know about, we trust it not to be mean to the user. | 202 // if it's a dialog we know about, we trust it not to be mean to the user. |
| 203 GetWidget()->SetBounds(pos); | 203 GetWidget()->SetBounds(pos); |
| 204 } | 204 } |
| 205 | 205 |
| 206 // A simplified version of BrowserView::HandleKeyboardEvent(). | 206 // A simplified version of BrowserView::HandleKeyboardEvent(). |
| 207 // We don't handle global keyboard shortcuts here, but that's fine since | 207 // We don't handle global keyboard shortcuts here, but that's fine since |
| 208 // they're all browser-specific. (This may change in the future.) | 208 // they're all browser-specific. (This may change in the future.) |
| 209 void HtmlDialogView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 209 void HtmlDialogView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 210 #if defined(OS_WIN) | 210 #if defined(USE_AURA) |
| 211 // TODO(saintlou): Need to provide some Aura handling. |
| 212 #elif defined(OS_WIN) |
| 211 // Any unhandled keyboard/character messages should be defproced. | 213 // Any unhandled keyboard/character messages should be defproced. |
| 212 // This allows stuff like F10, etc to work correctly. | 214 // This allows stuff like F10, etc to work correctly. |
| 213 DefWindowProc(event.os_event.hwnd, event.os_event.message, | 215 DefWindowProc(event.os_event.hwnd, event.os_event.message, |
| 214 event.os_event.wParam, event.os_event.lParam); | 216 event.os_event.wParam, event.os_event.lParam); |
| 215 #elif defined(TOOLKIT_USES_GTK) | 217 #elif defined(TOOLKIT_USES_GTK) |
| 216 views::NativeWidgetGtk* window_gtk = | 218 views::NativeWidgetGtk* window_gtk = |
| 217 static_cast<views::NativeWidgetGtk*>(GetWidget()->native_widget()); | 219 static_cast<views::NativeWidgetGtk*>(GetWidget()->native_widget()); |
| 218 if (event.os_event && !event.skip_in_browser) { | 220 if (event.os_event && !event.skip_in_browser) { |
| 219 views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event)); | 221 views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event)); |
| 220 window_gtk->HandleKeyboardEvent(views_event); | 222 window_gtk->HandleKeyboardEvent(views_event); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 break; | 283 break; |
| 282 default: | 284 default: |
| 283 NOTREACHED() << "unknown type" << type; | 285 NOTREACHED() << "unknown type" << type; |
| 284 } | 286 } |
| 285 } | 287 } |
| 286 | 288 |
| 287 void HtmlDialogView::RegisterDialogAccelerators() { | 289 void HtmlDialogView::RegisterDialogAccelerators() { |
| 288 // Pressing the ESC key will close the dialog. | 290 // Pressing the ESC key will close the dialog. |
| 289 AddAccelerator(views::Accelerator(ui::VKEY_ESCAPE, false, false, false)); | 291 AddAccelerator(views::Accelerator(ui::VKEY_ESCAPE, false, false, false)); |
| 290 } | 292 } |
| OLD | NEW |