Chromium Code Reviews| Index: ios/chrome/browser/ui/bubble_promo/bubble_view_controller.h |
| diff --git a/ios/chrome/browser/ui/bubble_promo/bubble_view_controller.h b/ios/chrome/browser/ui/bubble_promo/bubble_view_controller.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..494b391dc25c15a84a78af677ac2ca3d9037409a |
| --- /dev/null |
| +++ b/ios/chrome/browser/ui/bubble_promo/bubble_view_controller.h |
| @@ -0,0 +1,46 @@ |
| +// 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_BUBBLE_PROMO_BUBBLE_VIEW_CONTROLLER_H_ |
| +#define IOS_CHROME_BROWSER_UI_BUBBLE_PROMO_BUBBLE_VIEW_CONTROLLER_H_ |
| + |
| +#import <UIKit/UIKit.h> |
| + |
| +// Direction for the bubble to point. |
| +enum class BubbleArrowDirection { |
|
gchatz
2017/07/07 04:29:10
I think for the enums, we should use the NS_ENUM m
helenlyang
2017/07/07 23:29:16
Done.
|
| + // Bubble is below the target UI element and the arrow is pointing up. |
| + UP, |
| + // Bubble is above the target UI element and the arrow is pointing down. |
| + DOWN |
| +}; |
| + |
| +// Alignment of the bubble relative to the arrow. |
| +enum class BubbleAlignment { LEADING, CENTER, TRAILING }; |
| + |
| +// View controller that manages a BubbleView, which points to the UI element of |
|
gchatz
2017/07/07 04:29:10
Replace "the UI element" with "a UI element"
helenlyang
2017/07/07 23:29:16
Done.
|
| +// interest. |
| +@interface BubbleViewController : UIViewController |
| + |
| +// Initializes the bubble with the given text, arrow direction, and alignment. |
| +- (instancetype)initWithText:(NSString*)text |
| + direction:(BubbleArrowDirection)arrowDirection |
| + alignment:(BubbleAlignment)alignment |
| + NS_DESIGNATED_INITIALIZER; |
| + |
| +- (instancetype)init NS_UNAVAILABLE; |
| + |
| +- (instancetype)initWithNibName:(NSString*)nibNameOrNil |
| + bundle:(NSBundle*)nibBundleOrNil NS_UNAVAILABLE; |
| + |
| +- (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; |
| + |
| +// Animates the bubble in with a fade-in. |
| +- (void)animateContentIn; |
| + |
| +// Dismisses the bubble. If |animated| is true, the bubble fades out. |
| +- (void)dismissAnimated:(BOOL)animated; |
| + |
| +@end |
| + |
| +#endif // IOS_CHROME_BROWSER_UI_BUBBLE_PROMO_BUBBLE_VIEW_CONTROLLER_H_ |