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 #import "chrome/browser/cocoa/menu_controller.h" | 5 #import "chrome/browser/cocoa/menu_controller.h" |
6 | 6 |
7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
8 #include "app/menus/simple_menu_model.h" | 8 #include "app/menus/simple_menu_model.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 } | 134 } |
135 | 135 |
136 // Called when the user chooses a particular menu item. |sender| is the menu | 136 // Called when the user chooses a particular menu item. |sender| is the menu |
137 // item chosen. | 137 // item chosen. |
138 - (void)itemSelected:(id)sender { | 138 - (void)itemSelected:(id)sender { |
139 NSInteger modelIndex = [sender tag]; | 139 NSInteger modelIndex = [sender tag]; |
140 menus::MenuModel* model = | 140 menus::MenuModel* model = |
141 static_cast<menus::MenuModel*>( | 141 static_cast<menus::MenuModel*>( |
142 [[sender representedObject] pointerValue]); | 142 [[sender representedObject] pointerValue]); |
143 DCHECK(model); | 143 DCHECK(model); |
144 if (model); | 144 if (model) |
Mark Mentovai
2010/06/11 18:47:35
ha!
| |
145 model->ActivatedAt(modelIndex); | 145 model->ActivatedAt(modelIndex); |
146 } | 146 } |
147 | 147 |
148 - (NSMenu*)menu { | 148 - (NSMenu*)menu { |
149 return menu_.get(); | 149 return menu_.get(); |
150 } | 150 } |
151 | 151 |
152 @end | 152 @end |
OLD | NEW |