| 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..f5307714bc4ca3366ad54cb823490658e45e5ce6
|
| --- /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>
|
| +
|
| +// Defines the direction for the bubble to point.
|
| +enum class BubbleArrowDirection {
|
| + // 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 speech bubble-shaped view, which displays a
|
| +// message and points to the UI element of 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_
|
|
|