OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/cocoa/wrench_menu/wrench_menu_controller.h" | 5 #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 ui::MenuModel* model = [self recentTabsMenuModel]; | 280 ui::MenuModel* model = [self recentTabsMenuModel]; |
281 if (model) { | 281 if (model) { |
282 recentTabsMenuModelDelegate_.reset( | 282 recentTabsMenuModelDelegate_.reset( |
283 new RecentTabsMenuModelDelegate(model, [self recentTabsSubmenu])); | 283 new RecentTabsMenuModelDelegate(model, [self recentTabsSubmenu])); |
284 } | 284 } |
285 } | 285 } |
286 | 286 |
287 - (void)createModel { | 287 - (void)createModel { |
288 recentTabsMenuModelDelegate_.reset(); | 288 recentTabsMenuModelDelegate_.reset(); |
289 wrenchMenuModel_.reset( | 289 wrenchMenuModel_.reset( |
290 new WrenchMenuModel(acceleratorDelegate_.get(), browser_, false)); | 290 new WrenchMenuModel(acceleratorDelegate_.get(), browser_)); |
291 [self setModel:wrenchMenuModel_.get()]; | 291 [self setModel:wrenchMenuModel_.get()]; |
292 | 292 |
293 buttonViewController_.reset( | 293 buttonViewController_.reset( |
294 [[WrenchMenuButtonViewController alloc] initWithController:self]); | 294 [[WrenchMenuButtonViewController alloc] initWithController:self]); |
295 [buttonViewController_ view]; | 295 [buttonViewController_ view]; |
296 } | 296 } |
297 | 297 |
298 // Fit the localized strings into the Cut/Copy/Paste control, then resize the | 298 // Fit the localized strings into the Cut/Copy/Paste control, then resize the |
299 // whole menu item accordingly. | 299 // whole menu item accordingly. |
300 - (void)adjustPositioning { | 300 - (void)adjustPositioning { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 controller_ = controller; | 410 controller_ = controller; |
411 } | 411 } |
412 return self; | 412 return self; |
413 } | 413 } |
414 | 414 |
415 - (IBAction)dispatchWrenchMenuCommand:(id)sender { | 415 - (IBAction)dispatchWrenchMenuCommand:(id)sender { |
416 [controller_ dispatchWrenchMenuCommand:sender]; | 416 [controller_ dispatchWrenchMenuCommand:sender]; |
417 } | 417 } |
418 | 418 |
419 @end // @implementation WrenchMenuButtonViewController | 419 @end // @implementation WrenchMenuButtonViewController |
OLD | NEW |