Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_STACK_VIEW_CARD_SET_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_STACK_VIEW_CARD_SET_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_STACK_VIEW_CARD_SET_H_ | 6 #define IOS_CHROME_BROWSER_UI_STACK_VIEW_CARD_SET_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 // be cleared, and any card setup done again for the whole card set. | 40 // be cleared, and any card setup done again for the whole card set. |
| 41 // This is also called on initial creation of the card set. | 41 // This is also called on initial creation of the card set. |
| 42 - (void)cardSetRecreatedCards:(CardSet*)cardSet; | 42 - (void)cardSetRecreatedCards:(CardSet*)cardSet; |
| 43 | 43 |
| 44 @end | 44 @end |
| 45 | 45 |
| 46 // Manager for constructing a set of StackCards and displaying them in a view. | 46 // Manager for constructing a set of StackCards and displaying them in a view. |
| 47 @interface CardSet : NSObject | 47 @interface CardSet : NSObject |
| 48 // The layout manager for the set. | 48 // The layout manager for the set. |
| 49 // TODO(stuartmorgan): See if this can reasonably be internalized. | 49 // TODO(stuartmorgan): See if this can reasonably be internalized. |
| 50 @property(nonatomic, readonly) CardStackLayoutManager* stackModel; | 50 @property(weak, nonatomic, readonly) CardStackLayoutManager* stackModel; |
|
stkhapugin
2017/06/16 13:17:50
It seems like these four properties are all strong
marq (ping after 24h)
2017/06/19 10:34:24
I'll make them not-weak, but I don't want to fiddl
| |
| 51 // An array of StackCards in the same order as the tabs in the tab model. | 51 // An array of StackCards in the same order as the tabs in the tab model. |
| 52 @property(nonatomic, readonly) NSArray* cards; | 52 @property(weak, nonatomic, readonly) NSArray* cards; |
| 53 // The card corresponding to the currently selected tab in the tab model. | 53 // The card corresponding to the currently selected tab in the tab model. |
| 54 // Setting this property will change the selection in the tab model. | 54 // Setting this property will change the selection in the tab model. |
| 55 @property(nonatomic, assign, readwrite) StackCard* currentCard; | 55 @property(nonatomic, weak, readwrite) StackCard* currentCard; |
| 56 // Set to the card that is currently animating closed, if any. | 56 // Set to the card that is currently animating closed, if any. |
| 57 @property(nonatomic, assign, readwrite) StackCard* closingCard; | 57 @property(nonatomic, weak, readwrite) StackCard* closingCard; |
| 58 // The view that cards should be displayed in. Changing the display view will | 58 // The view that cards should be displayed in. Changing the display view will |
| 59 // remove cards from the previous view, but they will not be re-displayed in the | 59 // remove cards from the previous view, but they will not be re-displayed in the |
| 60 // new view without a call to updateCardVisibilities. | 60 // new view without a call to updateCardVisibilities. |
| 61 @property(nonatomic, retain, readwrite) UIView* displayView; | 61 @property(nonatomic, strong, readwrite) UIView* displayView; |
| 62 // The side on which the close button should be displayed. | 62 // The side on which the close button should be displayed. |
| 63 @property(nonatomic, readonly) CardCloseButtonSide closeButtonSide; | 63 @property(nonatomic, readonly) CardCloseButtonSide closeButtonSide; |
| 64 // The object to be notified about addition and removal of cards. | 64 // The object to be notified about addition and removal of cards. |
| 65 @property(nonatomic, assign, readwrite) id<CardSetObserver> observer; | 65 @property(nonatomic, weak, readwrite) id<CardSetObserver> observer; |
| 66 // While YES, changes to the tab model will not affect the card stack. When | 66 // While YES, changes to the tab model will not affect the card stack. When |
| 67 // this is changed back to NO, the card stack will be completely rebuilt, so | 67 // this is changed back to NO, the card stack will be completely rebuilt, so |
| 68 // this should be used very carefully. | 68 // this should be used very carefully. |
| 69 @property(nonatomic, assign, readwrite) BOOL ignoresTabModelChanges; | 69 @property(nonatomic, assign, readwrite) BOOL ignoresTabModelChanges; |
| 70 // While set to YES, |updateCardVisibilities| will elide setting the views | 70 // While set to YES, |updateCardVisibilities| will elide setting the views |
| 71 // of covered cards to hidden. Setting to NO will trigger a call to | 71 // of covered cards to hidden. Setting to NO will trigger a call to |
| 72 // |updateCardVisibilities| to hide any covered views. Can be set to YES | 72 // |updateCardVisibilities| to hide any covered views. Can be set to YES |
| 73 // during animations to ensure that cards being animated to not-visible | 73 // during animations to ensure that cards being animated to not-visible |
| 74 // positions remain visible throughout the animation; should be set back to | 74 // positions remain visible throughout the animation; should be set back to |
| 75 // NO on the completion of such animations. Default value is NO. | 75 // NO on the completion of such animations. Default value is NO. |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 - (void)updateShadowLayout; | 222 - (void)updateShadowLayout; |
| 223 | 223 |
| 224 @end | 224 @end |
| 225 | 225 |
| 226 @interface CardSet (Testing) | 226 @interface CardSet (Testing) |
| 227 - (StackCard*)cardForTab:(Tab*)tab; | 227 - (StackCard*)cardForTab:(Tab*)tab; |
| 228 - (void)setStackModelForTesting:(CardStackLayoutManager*)stackModel; | 228 - (void)setStackModelForTesting:(CardStackLayoutManager*)stackModel; |
| 229 @end | 229 @end |
| 230 | 230 |
| 231 #endif // IOS_CHROME_BROWSER_UI_STACK_VIEW_CARD_SET_H_ | 231 #endif // IOS_CHROME_BROWSER_UI_STACK_VIEW_CARD_SET_H_ |
| OLD | NEW |