Chromium Code Reviews| Index: ios/chrome/browser/ui/toolbar/keyboard_accessory_view.h |
| diff --git a/ios/chrome/browser/ui/toolbar/keyboard_accessory_view.h b/ios/chrome/browser/ui/toolbar/keyboard_accessory_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5f277f90cf83b3264f2483d689ff914950cbc233 |
| --- /dev/null |
| +++ b/ios/chrome/browser/ui/toolbar/keyboard_accessory_view.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef IOS_CHROME_BROWSER_UI_TOOLBAR_KEYBOARD_ACCESSORY_VIEW_H_ |
| +#define IOS_CHROME_BROWSER_UI_TOOLBAR_KEYBOARD_ACCESSORY_VIEW_H_ |
| + |
| +#import <UIKit/UIKIt.h> |
| + |
| +// Delegate protocol for the KeyboardAccessoryView. |
| +@protocol KeyboardAccessoryViewDelegate |
| + |
| +// Notifies the delegate that the Voice Search button was pressed. |
| +- (void)keyboardAccessoryVoiceSearchTouchDown; |
| + |
| +// Notifies the delegate that a touch up occured in the the Voice Search button. |
| +- (void)keyboardAccessoryVoiceSearchTouchUpInside; |
| + |
| +// Notifies the delegate that a key with the title |title| was pressed. |
| +- (void)keyPressed:(NSString*)title; |
| + |
| +@end |
| + |
| +typedef NS_ENUM(NSInteger, KeyboardAccessoryViewMode) { |
| + VOICE_SEARCH = 0, |
| + KEY_SHORTCUTS |
| +}; |
| + |
| +// Accessory View above the keyboard. |
| +// Supports two modes: one where a Voice Search button is shown, and one where |
| +// a list of buttons based on |buttonTitles| is shown. |
| +// The default mode is the Voice Search mode. |
| +@interface KeyboardAccessoryView : UIInputView<UIInputViewAudioFeedback> |
| + |
| +- (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; |
| + |
| +- (instancetype)initWithFrame:(CGRect)frame |
| + inputViewStyle:(UIInputViewStyle)inputViewStyle NS_UNAVAILABLE; |
| + |
|
marq (ping after 24h)
2017/06/02 09:15:10
Comment for the initializer, documenting behavior
|
| +- (instancetype)initWithButtons:(NSArray<NSString*>*)buttonTitles |
|
marq (ping after 24h)
2017/06/02 09:15:10
Optional style nit: Put the designated initializer
jif
2017/06/02 13:06:18
Done.
|
| + delegate:(id<KeyboardAccessoryViewDelegate>)delegate |
| + NS_DESIGNATED_INITIALIZER; |
| + |
| +// The mode in which the KeyboardAccessoryView is in. |
| +@property(nonatomic) KeyboardAccessoryViewMode mode; |
| + |
| +@end |
| + |
| +#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_KEYBOARD_ACCESSORY_VIEW_H_ |