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

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

Issue 3181029: Mac: Show a context menu for poup window. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 months 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
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/cocoa/browser_window_cocoa.h" 5 #include "chrome/browser/cocoa/browser_window_cocoa.h"
6 6
7 #include "app/l10n_util_mac.h" 7 #include "app/l10n_util_mac.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 // Other windows hear about it from the notification. 562 // Other windows hear about it from the notification.
563 case NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: 563 case NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED:
564 [controller_ updateBookmarkBarVisibilityWithAnimation:YES]; 564 [controller_ updateBookmarkBarVisibilityWithAnimation:YES];
565 break; 565 break;
566 default: 566 default:
567 NOTREACHED(); // we don't ask for anything else! 567 NOTREACHED(); // we don't ask for anything else!
568 break; 568 break;
569 } 569 }
570 } 570 }
571 571
572 bool BrowserWindowCocoa::IsCommandIdChecked(int command_id) const {
573 // Currently no items in our popup context menu are check-able.
574 return false;
575 }
576
577 bool BrowserWindowCocoa::IsCommandIdEnabled(int command_id) const {
578 return browser_->command_updater()->IsCommandEnabled(command_id);
579 }
580
581 bool BrowserWindowCocoa::GetAcceleratorForCommandId(
582 int command_id,
583 menus::Accelerator* accelerator) {
584 // This is not necessary because Cocoa does not show short-cut keys
585 // for context menu items.
586 return false;
587 }
588
589 void BrowserWindowCocoa::ExecuteCommand(int command_id) {
590 browser_->ExecuteCommand(command_id);
591 }
592
572 void BrowserWindowCocoa::DestroyBrowser() { 593 void BrowserWindowCocoa::DestroyBrowser() {
573 [controller_ destroyBrowser]; 594 [controller_ destroyBrowser];
574 595
575 // at this point the controller is dead (autoreleased), so 596 // at this point the controller is dead (autoreleased), so
576 // make sure we don't try to reference it any more. 597 // make sure we don't try to reference it any more.
577 } 598 }
578 599
579 NSWindow* BrowserWindowCocoa::window() const { 600 NSWindow* BrowserWindowCocoa::window() const {
580 return [controller_ window]; 601 return [controller_ window];
581 } 602 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698