| 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_mac.h" | 5 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. | 9 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. |
| 10 #import "chrome/browser/cocoa/focus_tracker.h" | 10 #import "chrome/browser/cocoa/focus_tracker.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 - (TabContents*)tabContents { | 292 - (TabContents*)tabContents { |
| 293 return tabContentsView_->tab_contents(); | 293 return tabContentsView_->tab_contents(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 - (void)processKeyboardEvent:(NSEvent*)event { | 296 - (void)processKeyboardEvent:(NSEvent*)event { |
| 297 // If this tab is no longer active, it's window will be |nil|. In that case, | 297 // If this tab is no longer active, it's window will be |nil|. In that case, |
| 298 // best ignore the event. | 298 // best ignore the event. |
| 299 if (![self window]) | 299 if (![self window]) |
| 300 return; | 300 return; |
| 301 | 301 |
| 302 ChromeBrowserWindow* window = (ChromeBrowserWindow*)[self window]; | 302 // Do not fire shortcuts on key up. |
| 303 DCHECK([window isKindOfClass:[ChromeBrowserWindow class]]); | 303 if ([event type] == NSKeyDown) { |
| 304 if ([window handleExtraBrowserKeyboardShortcut:event]) | 304 ChromeBrowserWindow* window = (ChromeBrowserWindow*)[self window]; |
| 305 return; | 305 DCHECK([window isKindOfClass:[ChromeBrowserWindow class]]); |
| 306 if ([window handleExtraWindowKeyboardShortcut:event]) | 306 if ([window handleExtraBrowserKeyboardShortcut:event]) |
| 307 return; | 307 return; |
| 308 if ([window handleExtraWindowKeyboardShortcut:event]) |
| 309 return; |
| 310 } |
| 308 | 311 |
| 309 if ([event type] == NSKeyDown) | 312 if ([event type] == NSKeyDown) |
| 310 [super keyDown:event]; | 313 [super keyDown:event]; |
| 311 else if ([event type] == NSKeyUp) | 314 else if ([event type] == NSKeyUp) |
| 312 [super keyUp:event]; | 315 [super keyUp:event]; |
| 313 } | 316 } |
| 314 | 317 |
| 315 - (void)mouseEvent:(NSEvent *)theEvent { | 318 - (void)mouseEvent:(NSEvent *)theEvent { |
| 316 TabContents* tabContents = [self tabContents]; | 319 TabContents* tabContents = [self tabContents]; |
| 317 if (tabContents->delegate()) { | 320 if (tabContents->delegate()) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 } | 420 } |
| 418 | 421 |
| 419 - (BOOL)performDragOperation:(id<NSDraggingInfo>)sender { | 422 - (BOOL)performDragOperation:(id<NSDraggingInfo>)sender { |
| 420 return [dropTarget_ performDragOperation:sender view:self]; | 423 return [dropTarget_ performDragOperation:sender view:self]; |
| 421 } | 424 } |
| 422 | 425 |
| 423 // Tons of stuff goes here, where we grab events going on in Cocoaland and send | 426 // Tons of stuff goes here, where we grab events going on in Cocoaland and send |
| 424 // them into the C++ system. TODO(avi): all that jazz | 427 // them into the C++ system. TODO(avi): all that jazz |
| 425 | 428 |
| 426 @end | 429 @end |
| OLD | NEW |