| OLD | NEW |
| 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_COCOA_TAB_CONTROLLER_TARGET_H_ | 5 #ifndef CHROME_BROWSER_COCOA_TAB_CONTROLLER_TARGET_H_ |
| 6 #define CHROME_BROWSER_COCOA_TAB_CONTROLLER_TARGET_H_ | 6 #define CHROME_BROWSER_COCOA_TAB_CONTROLLER_TARGET_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
| 9 | 9 |
| 10 @class TabController; | 10 @class TabController; |
| 11 | 11 |
| 12 // A protocol to be implemented by a TabController's target. | 12 // A protocol to be implemented by a TabController's target. |
| 13 @protocol TabControllerTarget | 13 @protocol TabControllerTarget |
| 14 - (void)selectTab:(id)sender; | 14 - (void)selectTab:(id)sender; |
| 15 - (void)closeTab:(id)sender; | 15 - (void)closeTab:(id)sender; |
| 16 | 16 |
| 17 // Dispatch context menu commands for the given tab controller. | 17 // Dispatch context menu commands for the given tab controller. |
| 18 - (void)commandDispatch:(TabStripModel::ContextMenuCommand)command | 18 - (void)commandDispatch:(TabStripModel::ContextMenuCommand)command |
| 19 forController:(TabController*)controller; | 19 forController:(TabController*)controller; |
| 20 // Returns YES if the specificed command should be enabled for the given | 20 // Returns YES if the specificed command should be enabled for the given |
| 21 // controller. | 21 // controller. |
| 22 - (BOOL)isCommandEnabled:(TabStripModel::ContextMenuCommand)command | 22 - (BOOL)isCommandEnabled:(TabStripModel::ContextMenuCommand)command |
| 23 forController:(TabController*)controller; | 23 forController:(TabController*)controller; |
| 24 // Returns the index of the tab controller. Returns -1 if not present. |
| 25 // Total number of tab controllers owned by the target will be returned |
| 26 // in |*total|; |
| 27 - (NSInteger)indexForTabController:(TabController*)controller |
| 28 inTotal:(NSInteger*)total; |
| 24 @end | 29 @end |
| 25 | 30 |
| 26 #endif // CHROME_BROWSER_COCOA_TAB_CONTROLLER_TARGET_H_ | 31 #endif // CHROME_BROWSER_COCOA_TAB_CONTROLLER_TARGET_H_ |
| OLD | NEW |