Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 5576002: Fix BrowserKeyEventsTest.ReservedAccelerators on Mac 10.6 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add cr_firesForKeyEventIfEnabled. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698