| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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_BUBBLE_PROMO_BUBBLE_VIEW_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_BUBBLE_PROMO_BUBBLE_VIEW_CONTROLLER_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 // Defines the direction for the bubble to point. |
| 11 enum class BubbleArrowDirection { |
| 12 // Bubble is below the target UI element and the arrow is pointing up. |
| 13 UP, |
| 14 // Bubble is above the target UI element and the arrow is pointing down. |
| 15 DOWN |
| 16 }; |
| 17 |
| 18 // Alignment of the bubble relative to the arrow. |
| 19 enum class BubbleAlignment { LEADING, CENTER, TRAILING }; |
| 20 |
| 21 // View controller that manages a speech bubble-shaped view, which displays a |
| 22 // message and points to the UI element of interest. |
| 23 @interface BubbleViewController : UIViewController |
| 24 |
| 25 // Initializes the bubble with the given text, arrow direction, and alignment. |
| 26 - (instancetype)initWithText:(NSString*)text |
| 27 direction:(BubbleArrowDirection)arrowDirection |
| 28 alignment:(BubbleAlignment)alignment |
| 29 NS_DESIGNATED_INITIALIZER; |
| 30 |
| 31 - (instancetype)init NS_UNAVAILABLE; |
| 32 |
| 33 - (instancetype)initWithNibName:(NSString*)nibNameOrNil |
| 34 bundle:(NSBundle*)nibBundleOrNil NS_UNAVAILABLE; |
| 35 |
| 36 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; |
| 37 |
| 38 // Animates the bubble in with a fade-in. |
| 39 - (void)animateContentIn; |
| 40 |
| 41 // Dismisses the bubble. If |animated| is true, the bubble fades out. |
| 42 - (void)dismissAnimated:(BOOL)animated; |
| 43 |
| 44 @end |
| 45 |
| 46 #endif // IOS_CHROME_BROWSER_UI_BUBBLE_PROMO_BUBBLE_VIEW_CONTROLLER_H_ |
| OLD | NEW |