| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ui/cocoa/browser_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 6 | 6 |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 + (NSMenuItem*)itemForKeyEquivalent:(NSEvent*)key | 458 + (NSMenuItem*)itemForKeyEquivalent:(NSEvent*)key |
| 459 menu:(NSMenu*)menu { | 459 menu:(NSMenu*)menu { |
| 460 NSMenuItem* result = nil; | 460 NSMenuItem* result = nil; |
| 461 | 461 |
| 462 for (NSMenuItem *item in [menu itemArray]) { | 462 for (NSMenuItem *item in [menu itemArray]) { |
| 463 NSMenu* submenu = [item submenu]; | 463 NSMenu* submenu = [item submenu]; |
| 464 if (submenu) { | 464 if (submenu) { |
| 465 if (submenu != [NSApp servicesMenu]) | 465 if (submenu != [NSApp servicesMenu]) |
| 466 result = [self itemForKeyEquivalent:key | 466 result = [self itemForKeyEquivalent:key |
| 467 menu:submenu]; | 467 menu:submenu]; |
| 468 } else if ([item cr_firesForKeyEvent:key]) { | 468 } else if ([item cr_firesForKeyEventIfEnabled:key]) { |
| 469 result = item; | 469 result = item; |
| 470 } | 470 } |
| 471 | 471 |
| 472 if (result) | 472 if (result) |
| 473 break; | 473 break; |
| 474 } | 474 } |
| 475 | 475 |
| 476 return result; | 476 return result; |
| 477 } | 477 } |
| 478 @end | 478 @end |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 | 629 |
| 630 NSWindow* BrowserWindowCocoa::window() const { | 630 NSWindow* BrowserWindowCocoa::window() const { |
| 631 return [controller_ window]; | 631 return [controller_ window]; |
| 632 } | 632 } |
| 633 | 633 |
| 634 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) { | 634 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) { |
| 635 if (tab_contents == browser_->GetSelectedTabContents()) { | 635 if (tab_contents == browser_->GetSelectedTabContents()) { |
| 636 [controller_ updateSidebarForContents:tab_contents]; | 636 [controller_ updateSidebarForContents:tab_contents]; |
| 637 } | 637 } |
| 638 } | 638 } |
| OLD | NEW |