| 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/tab_contents_view_win.h" | 5 #include "chrome/browser/tab_contents/tab_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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 (event.modifiers & WebInputEvent::ControlKey) == | 351 (event.modifiers & WebInputEvent::ControlKey) == |
| 352 WebInputEvent::ControlKey, | 352 WebInputEvent::ControlKey, |
| 353 (event.modifiers & WebInputEvent::AltKey) == | 353 (event.modifiers & WebInputEvent::AltKey) == |
| 354 WebInputEvent::AltKey); | 354 WebInputEvent::AltKey); |
| 355 | 355 |
| 356 // This is tricky: we want to set ignore_next_char_event_ if | 356 // This is tricky: we want to set ignore_next_char_event_ if |
| 357 // ProcessAccelerator returns true. But ProcessAccelerator might delete | 357 // ProcessAccelerator returns true. But ProcessAccelerator might delete |
| 358 // |this| if the accelerator is a "close tab" one. So we speculatively | 358 // |this| if the accelerator is a "close tab" one. So we speculatively |
| 359 // set the flag and fix it if no event was handled. | 359 // set the flag and fix it if no event was handled. |
| 360 ignore_next_char_event_ = true; | 360 ignore_next_char_event_ = true; |
| 361 if (focus_manager->ProcessAccelerator(accelerator, false)) { | 361 if (focus_manager->ProcessAccelerator(accelerator)) { |
| 362 // DANGER: |this| could be deleted now! | 362 // DANGER: |this| could be deleted now! |
| 363 return; | 363 return; |
| 364 } else { | 364 } else { |
| 365 // ProcessAccelerator didn't handle the accelerator, so we know both | 365 // ProcessAccelerator didn't handle the accelerator, so we know both |
| 366 // that |this| is still valid, and that we didn't want to set the flag. | 366 // that |this| is still valid, and that we didn't want to set the flag. |
| 367 ignore_next_char_event_ = false; | 367 ignore_next_char_event_ = false; |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 } | 370 } |
| 371 | 371 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 } | 607 } |
| 608 return false; | 608 return false; |
| 609 } | 609 } |
| 610 | 610 |
| 611 void TabContentsViewWin::WheelZoom(int distance) { | 611 void TabContentsViewWin::WheelZoom(int distance) { |
| 612 if (web_contents()->delegate()) { | 612 if (web_contents()->delegate()) { |
| 613 bool zoom_in = distance > 0; | 613 bool zoom_in = distance > 0; |
| 614 web_contents()->delegate()->ContentsZoomChange(zoom_in); | 614 web_contents()->delegate()->ContentsZoomChange(zoom_in); |
| 615 } | 615 } |
| 616 } | 616 } |
| OLD | NEW |