Chromium Code Reviews| 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_CONFIGURATION_H_ | |
| 6 #define IOS_CHROME_BROWSER_UI_BUBBLE_PROMO_BUBBLE_CONFIGURATION_H_ | |
| 7 | |
| 8 #import <UIKit/UIKit.h> | |
| 9 | |
| 10 // Defines the direction for the bubble to point. | |
| 11 enum class BubbleArrowDirection { | |
|
edchin
2017/07/01 15:29:27
How about calling it "PointingDirection"? This sho
helenlyang
2017/07/05 20:35:36
I felt that "BubbleArrowDirection" was more consis
edchin
2017/07/06 04:56:18
Good point. And good application of consistency wi
| |
| 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 }; | |
|
edchin
2017/07/01 15:29:27
This should be in the BubbleVC header.
helenlyang
2017/07/05 20:35:36
Done.
| |
| 20 | |
| 21 // Configuration object for BubbleViewController that provides information | |
| 22 // needed to set the position and text of the bubble. | |
| 23 @interface BubbleConfiguration : NSObject | |
|
edchin
2017/07/01 15:29:27
The original purpose of this class was to extract
helenlyang
2017/07/05 20:35:36
Agreed; removed this class as you suggested.
| |
| 24 | |
| 25 @property(nonatomic) NSString* displayText; | |
|
edchin
2017/07/01 15:29:27
Drawing inspiration from UILabel and UIButton, the
helenlyang
2017/07/05 20:35:36
I've added a label property to BubbleView. Since i
edchin
2017/07/06 04:56:18
Acknowledged.
| |
| 26 @property(nonatomic) BubbleAlignment* alignment; | |
|
edchin
2017/07/01 15:29:27
Enums should not be pointers. Pointers are only us
helenlyang
2017/07/05 20:35:37
Done.
| |
| 27 @property(nonatomic) BubbleArrowDirection* arrowDirection; | |
| 28 // View of the targeted UI element. | |
| 29 @property(nonatomic, weak) UIView* elementView; | |
| 30 // View that the bubble will be displayed in. | |
| 31 @property(nonatomic, readonly, weak) UIView* bubbleSuperview; | |
| 32 // Frame of |elementView| relative to |bubbleSuperview|'s coordinate system. | |
| 33 // This is the rectangle in which the bubble will be anchored. | |
| 34 @property(nonatomic, readonly) CGRect sourceRect; | |
| 35 | |
| 36 // Initializes the BubbleConfiguration object with default values. | |
| 37 - (instancetype)initWithBubbleSuperview:(UIView*)bubbleSuperview | |
| 38 NS_DESIGNATED_INITIALIZER; | |
| 39 - (instancetype)init NS_UNAVAILABLE; | |
| 40 | |
| 41 @end | |
| 42 | |
| 43 #endif // IOS_CHROME_BROWSER_UI_BUBBLE_PROMO_BUBBLE_CONFIGURATION_H_ | |
| OLD | NEW |