OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_KEY_COMMANDS_PROVIDER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_KEY_COMMANDS_PROVIDER_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 @protocol KeyCommandsPlumbing<NSObject> |
| 11 |
| 12 #pragma mark Query information |
| 13 |
| 14 // Whether the current profile is off-the-record. |
| 15 - (BOOL)isOffTheRecord; |
| 16 |
| 17 // Returns the current number of tabs. |
| 18 - (NSUInteger)tabsCount; |
| 19 |
| 20 #pragma mark Call for action |
| 21 |
| 22 // Executes a Chrome command. |sender| must implement the |-tag| method and |
| 23 // return the id of the command to execute. See UIKit+ChromeExecuteCommand.h |
| 24 // for more details. |
| 25 - (void)chromeExecuteCommand:(id)sender; |
| 26 |
| 27 // Called to put the tab at index in focus. |
| 28 - (void)focusTabAtIndex:(NSUInteger)index; |
| 29 |
| 30 // Called to focus the next tab. |
| 31 - (void)focusNextTab; |
| 32 |
| 33 // Called to focus the previous tab. |
| 34 - (void)focusPreviousTab; |
| 35 |
| 36 // Called to reopen the last closed tab. |
| 37 - (void)reopenClosedTab; |
| 38 |
| 39 // Called to focus the omnibox. |
| 40 - (void)focusOmnibox; |
| 41 |
| 42 @end |
| 43 |
| 44 // Handles the keyboard commands registration and handling for the |
| 45 // BrowserViewController. |
| 46 @interface KeyCommandsProvider : NSObject |
| 47 |
| 48 - (NSArray*)keyCommandsForConsumer:(id<KeyCommandsPlumbing>)consumer |
| 49 editingText:(BOOL)editingText; |
| 50 |
| 51 @end |
| 52 |
| 53 #endif // IOS_CHROME_BROWSER_UI_KEY_COMMANDS_PROVIDER_H_ |
OLD | NEW |