Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: ios/chrome/browser/ui/bubble_promo/bubble_configuration.h

Issue 2964233002: [ios] BubbleViewController and BubbleView stubs. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/bubble_promo/bubble_configuration.h
diff --git a/ios/chrome/browser/ui/bubble_promo/bubble_configuration.h b/ios/chrome/browser/ui/bubble_promo/bubble_configuration.h
new file mode 100644
index 0000000000000000000000000000000000000000..e40f2b176922d633a5824421dd64959dd6e2c97e
--- /dev/null
+++ b/ios/chrome/browser/ui/bubble_promo/bubble_configuration.h
@@ -0,0 +1,43 @@
+// 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_CONFIGURATION_H_
+#define IOS_CHROME_BROWSER_UI_BUBBLE_PROMO_BUBBLE_CONFIGURATION_H_
+
+#import <UIKit/UIKit.h>
+
+// Defines the direction for the bubble to point.
+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
+ // 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 };
edchin 2017/07/01 15:29:27 This should be in the BubbleVC header.
helenlyang 2017/07/05 20:35:36 Done.
+
+// Configuration object for BubbleViewController that provides information
+// needed to set the position and text of the bubble.
+@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.
+
+@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.
+@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.
+@property(nonatomic) BubbleArrowDirection* arrowDirection;
+// View of the targeted UI element.
+@property(nonatomic, weak) UIView* elementView;
+// View that the bubble will be displayed in.
+@property(nonatomic, readonly, weak) UIView* bubbleSuperview;
+// Frame of |elementView| relative to |bubbleSuperview|'s coordinate system.
+// This is the rectangle in which the bubble will be anchored.
+@property(nonatomic, readonly) CGRect sourceRect;
+
+// Initializes the BubbleConfiguration object with default values.
+- (instancetype)initWithBubbleSuperview:(UIView*)bubbleSuperview
+ NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_BUBBLE_PROMO_BUBBLE_CONFIGURATION_H_

Powered by Google App Engine
This is Rietveld 408576698