| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/tab_contents/web_contents_view_win.h" | 5 #include "chrome/browser/tab_contents/web_contents_view_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 9 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
| 10 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. | 10 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 // KEY_DOWN events, even if the latter triggered an accelerator. In these | 230 // KEY_DOWN events, even if the latter triggered an accelerator. In these |
| 231 // cases, we discard the CHAR events. | 231 // cases, we discard the CHAR events. |
| 232 if (event.type == WebInputEvent::CHAR && ignore_next_char_event_) { | 232 if (event.type == WebInputEvent::CHAR && ignore_next_char_event_) { |
| 233 ignore_next_char_event_ = false; | 233 ignore_next_char_event_ = false; |
| 234 return; | 234 return; |
| 235 } | 235 } |
| 236 ignore_next_char_event_ = false; | 236 ignore_next_char_event_ = false; |
| 237 | 237 |
| 238 // The renderer returned a keyboard event it did not process. This may be | 238 // The renderer returned a keyboard event it did not process. This may be |
| 239 // a keyboard shortcut that we have to process. | 239 // a keyboard shortcut that we have to process. |
| 240 if (event.type == WebInputEvent::KEY_DOWN) { | 240 if (event.type == WebInputEvent::RAW_KEY_DOWN) { |
| 241 views::FocusManager* focus_manager = | 241 views::FocusManager* focus_manager = |
| 242 views::FocusManager::GetFocusManager(GetHWND()); | 242 views::FocusManager::GetFocusManager(GetHWND()); |
| 243 // We may not have a focus_manager at this point (if the tab has been | 243 // We may not have a focus_manager at this point (if the tab has been |
| 244 // switched by the time this message returned). | 244 // switched by the time this message returned). |
| 245 if (focus_manager) { | 245 if (focus_manager) { |
| 246 views::Accelerator accelerator(event.key_code, | 246 views::Accelerator accelerator(event.windows_key_code, |
| 247 (event.modifiers & WebInputEvent::SHIFT_KEY) == | 247 (event.modifiers & WebInputEvent::SHIFT_KEY) == |
| 248 WebInputEvent::SHIFT_KEY, | 248 WebInputEvent::SHIFT_KEY, |
| 249 (event.modifiers & WebInputEvent::CTRL_KEY) == | 249 (event.modifiers & WebInputEvent::CTRL_KEY) == |
| 250 WebInputEvent::CTRL_KEY, | 250 WebInputEvent::CTRL_KEY, |
| 251 (event.modifiers & WebInputEvent::ALT_KEY) == | 251 (event.modifiers & WebInputEvent::ALT_KEY) == |
| 252 WebInputEvent::ALT_KEY); | 252 WebInputEvent::ALT_KEY); |
| 253 | 253 |
| 254 // This is tricky: we want to set ignore_next_char_event_ if | 254 // This is tricky: we want to set ignore_next_char_event_ if |
| 255 // ProcessAccelerator returns true. But ProcessAccelerator might delete | 255 // ProcessAccelerator returns true. But ProcessAccelerator might delete |
| 256 // |this| if the accelerator is a "close tab" one. So we speculatively | 256 // |this| if the accelerator is a "close tab" one. So we speculatively |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 } | 600 } |
| 601 return false; | 601 return false; |
| 602 } | 602 } |
| 603 | 603 |
| 604 void WebContentsViewWin::WheelZoom(int distance) { | 604 void WebContentsViewWin::WheelZoom(int distance) { |
| 605 if (web_contents_->delegate()) { | 605 if (web_contents_->delegate()) { |
| 606 bool zoom_in = distance > 0; | 606 bool zoom_in = distance > 0; |
| 607 web_contents_->delegate()->ContentsZoomChange(zoom_in); | 607 web_contents_->delegate()->ContentsZoomChange(zoom_in); |
| 608 } | 608 } |
| 609 } | 609 } |
| OLD | NEW |