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 #import <Carbon/Carbon.h> | 5 #import <Carbon/Carbon.h> |
6 | 6 |
7 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" | 7 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 349 |
350 - (void)setCurrentDragOperation:(NSDragOperation)operation { | 350 - (void)setCurrentDragOperation:(NSDragOperation)operation { |
351 [dropTarget_ setCurrentOperation:operation]; | 351 [dropTarget_ setCurrentOperation:operation]; |
352 } | 352 } |
353 | 353 |
354 - (TabContents*)tabContents { | 354 - (TabContents*)tabContents { |
355 return tabContentsView_->tab_contents(); | 355 return tabContentsView_->tab_contents(); |
356 } | 356 } |
357 | 357 |
358 - (BOOL)processKeyboardEvent:(NativeWebKeyboardEvent*)wkEvent { | 358 - (BOOL)processKeyboardEvent:(NativeWebKeyboardEvent*)wkEvent { |
359 if (wkEvent->skip_in_browser) | 359 if (wkEvent->skip_in_browser || wkEvent->type == WebKit::WebInputEvent::Char) |
360 return NO; | 360 return NO; |
361 | 361 |
362 NSEvent* event = wkEvent->os_event; | 362 NSEvent* event = wkEvent->os_event; |
363 | 363 DCHECK(event != NULL); |
364 if (!event) { | |
365 // Char events are synthesized and do not contain a real event. We are not | |
366 // interested in them anyway. | |
367 DCHECK(wkEvent->type == WebKit::WebInputEvent::Char); | |
368 return NO; | |
369 } | |
370 | 364 |
371 // If this tab is no longer active, its window will be |nil|. In that case, | 365 // If this tab is no longer active, its window will be |nil|. In that case, |
372 // best ignore the event. | 366 // best ignore the event. |
373 if (![self window]) | 367 if (![self window]) |
374 return NO; | 368 return NO; |
375 ChromeEventProcessingWindow* window = | 369 ChromeEventProcessingWindow* window = |
376 (ChromeEventProcessingWindow*)[self window]; | 370 (ChromeEventProcessingWindow*)[self window]; |
377 DCHECK([window isKindOfClass:[ChromeEventProcessingWindow class]]); | 371 DCHECK([window isKindOfClass:[ChromeEventProcessingWindow class]]); |
378 | 372 |
379 // Do not fire shortcuts on key up. | 373 // Do not fire shortcuts on key up. |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 } | 528 } |
535 | 529 |
536 - (void)closeTabAfterEvent { | 530 - (void)closeTabAfterEvent { |
537 tabContentsView_->CloseTab(); | 531 tabContentsView_->CloseTab(); |
538 } | 532 } |
539 | 533 |
540 // Tons of stuff goes here, where we grab events going on in Cocoaland and send | 534 // Tons of stuff goes here, where we grab events going on in Cocoaland and send |
541 // them into the C++ system. TODO(avi): all that jazz | 535 // them into the C++ system. TODO(avi): all that jazz |
542 | 536 |
543 @end | 537 @end |
OLD | NEW |