| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/bookmark_bar_view.h" | 5 #include "chrome/browser/cocoa/bookmark_bar_view.h" |
| 6 | 6 |
| 7 @implementation BookmarkBarView | 7 @implementation BookmarkBarView |
| 8 |
| 9 // Only hit in a unit test. |
| 10 - (void)setContextMenu:(NSMenu*)menu { |
| 11 barContextualMenu_ = menu; |
| 12 } |
| 13 |
| 14 // Unlike controls, generic views don't have a well-defined context |
| 15 // menu (e.g. responds to the "menu" selector). So we add our own. |
| 16 - (NSMenu *)menuForEvent:(NSEvent *)event { |
| 17 if ([event type] == NSRightMouseDown) |
| 18 return barContextualMenu_; |
| 19 return nil; |
| 20 } |
| 21 |
| 8 @end | 22 @end |
| OLD | NEW |