OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tabs/tab_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 owner_(owner) {} | 41 owner_(owner) {} |
42 | 42 |
43 // Overridden from ui::SimpleMenuModel::Delegate | 43 // Overridden from ui::SimpleMenuModel::Delegate |
44 bool IsCommandIdChecked(int command_id) const override { return false; } | 44 bool IsCommandIdChecked(int command_id) const override { return false; } |
45 bool IsCommandIdEnabled(int command_id) const override { | 45 bool IsCommandIdEnabled(int command_id) const override { |
46 TabStripModel::ContextMenuCommand command = | 46 TabStripModel::ContextMenuCommand command = |
47 static_cast<TabStripModel::ContextMenuCommand>(command_id); | 47 static_cast<TabStripModel::ContextMenuCommand>(command_id); |
48 return [target_ isCommandEnabled:command forController:owner_]; | 48 return [target_ isCommandEnabled:command forController:owner_]; |
49 } | 49 } |
50 bool GetAcceleratorForCommandId(int command_id, | 50 bool GetAcceleratorForCommandId(int command_id, |
51 ui::Accelerator* accelerator) override { | 51 ui::Accelerator* accelerator) const override { |
52 return false; | 52 return false; |
53 } | 53 } |
54 void ExecuteCommand(int command_id, int event_flags) override { | 54 void ExecuteCommand(int command_id, int event_flags) override { |
55 TabStripModel::ContextMenuCommand command = | 55 TabStripModel::ContextMenuCommand command = |
56 static_cast<TabStripModel::ContextMenuCommand>(command_id); | 56 static_cast<TabStripModel::ContextMenuCommand>(command_id); |
57 [target_ commandDispatch:command forController:owner_]; | 57 [target_ commandDispatch:command forController:owner_]; |
58 } | 58 } |
59 | 59 |
60 private: | 60 private: |
61 id<TabControllerTarget> target_; // weak | 61 id<TabControllerTarget> target_; // weak |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 YES : NO; | 467 YES : NO; |
468 } | 468 } |
469 return NO; | 469 return NO; |
470 } | 470 } |
471 | 471 |
472 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab { | 472 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab { |
473 [[target_ dragController] maybeStartDrag:event forTab:tab]; | 473 [[target_ dragController] maybeStartDrag:event forTab:tab]; |
474 } | 474 } |
475 | 475 |
476 @end | 476 @end |
OLD | NEW |