| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "chrome/app/vector_icons/vector_icons.h" | 10 #include "chrome/app/vector_icons/vector_icons.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 return NO; | 296 return NO; |
| 297 | 297 |
| 298 // Forward the event to the renderer. | 298 // Forward the event to the renderer. |
| 299 // TODO(rohitrao): Should this call -[BaseView keyEvent:]? Is there code in | 299 // TODO(rohitrao): Should this call -[BaseView keyEvent:]? Is there code in |
| 300 // that function that we want to keep or avoid? Calling | 300 // that function that we want to keep or avoid? Calling |
| 301 // |ForwardKeyboardEvent()| directly ignores edit commands, which breaks | 301 // |ForwardKeyboardEvent()| directly ignores edit commands, which breaks |
| 302 // cmd-up/down if we ever decide to include |moveToBeginningOfDocument:| in | 302 // cmd-up/down if we ever decide to include |moveToBeginningOfDocument:| in |
| 303 // the list above. | 303 // the list above. |
| 304 content::RenderViewHost* render_view_host = | 304 content::RenderViewHost* render_view_host = |
| 305 web_contents->GetRenderViewHost(); | 305 web_contents->GetRenderViewHost(); |
| 306 |
| 307 // TODO(tdresser): get the hardware timestamp from the NSEvent. |
| 306 render_view_host->GetWidget()->ForwardKeyboardEvent( | 308 render_view_host->GetWidget()->ForwardKeyboardEvent( |
| 307 NativeWebKeyboardEvent(event)); | 309 NativeWebKeyboardEvent(event)); |
| 308 return YES; | 310 return YES; |
| 309 } | 311 } |
| 310 | 312 |
| 311 return NO; | 313 return NO; |
| 312 } | 314 } |
| 313 | 315 |
| 314 // Methods from FindBar | 316 // Methods from FindBar |
| 315 - (void)showFindBar:(BOOL)animate { | 317 - (void)showFindBar:(BOOL)animate { |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 } | 663 } |
| 662 | 664 |
| 663 - (BrowserWindowController*)browserWindowController { | 665 - (BrowserWindowController*)browserWindowController { |
| 664 if (!browser_) | 666 if (!browser_) |
| 665 return nil; | 667 return nil; |
| 666 return [BrowserWindowController | 668 return [BrowserWindowController |
| 667 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()]; | 669 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()]; |
| 668 } | 670 } |
| 669 | 671 |
| 670 @end | 672 @end |
| OLD | NEW |