| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 - (int)maxWidthForMenuModel:(ui::MenuModel*)model | 47 - (int)maxWidthForMenuModel:(ui::MenuModel*)model |
| 48 modelIndex:(int)modelIndex; | 48 modelIndex:(int)modelIndex; |
| 49 @end | 49 @end |
| 50 | 50 |
| 51 namespace WrenchMenuControllerInternal { | 51 namespace WrenchMenuControllerInternal { |
| 52 | 52 |
| 53 // A C++ delegate that handles the accelerators in the wrench menu. | 53 // A C++ delegate that handles the accelerators in the wrench menu. |
| 54 class AcceleratorDelegate : public ui::AcceleratorProvider { | 54 class AcceleratorDelegate : public ui::AcceleratorProvider { |
| 55 public: | 55 public: |
| 56 virtual bool GetAcceleratorForCommandId(int command_id, | 56 virtual bool GetAcceleratorForCommandId(int command_id, |
| 57 ui::Accelerator* out_accelerator) OVERRIDE { | 57 ui::Accelerator* out_accelerator) override { |
| 58 AcceleratorsCocoa* keymap = AcceleratorsCocoa::GetInstance(); | 58 AcceleratorsCocoa* keymap = AcceleratorsCocoa::GetInstance(); |
| 59 const ui::Accelerator* accelerator = | 59 const ui::Accelerator* accelerator = |
| 60 keymap->GetAcceleratorForCommand(command_id); | 60 keymap->GetAcceleratorForCommand(command_id); |
| 61 if (!accelerator) | 61 if (!accelerator) |
| 62 return false; | 62 return false; |
| 63 *out_accelerator = *accelerator; | 63 *out_accelerator = *accelerator; |
| 64 return true; | 64 return true; |
| 65 } | 65 } |
| 66 }; | 66 }; |
| 67 | 67 |
| (...skipping 342 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 |