OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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_BOOKMARKS_BOOKMARK_PROMO_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_PROMO_CONTROLLER_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 namespace ios { |
| 11 class ChromeBrowserState; |
| 12 } // namespace ios |
| 13 |
| 14 namespace user_prefs { |
| 15 class PrefRegistrySyncable; |
| 16 } // namespace user_prefs |
| 17 |
| 18 @protocol BookmarkPromoControllerDelegate |
| 19 |
| 20 // Controls the state of the promo. |
| 21 - (void)promoStateChanged:(BOOL)promoEnabled; |
| 22 |
| 23 @end |
| 24 |
| 25 // This controller manages the display of the promo cell through its delegate |
| 26 // and handles displaying the sign-in view controller. |
| 27 @interface BookmarkPromoController : NSObject |
| 28 |
| 29 @property(nonatomic, assign) id<BookmarkPromoControllerDelegate> delegate; |
| 30 |
| 31 // Holds the current state of the promo. When the promo state change, it will |
| 32 // call the promoStateChanged: selector on the delegate. |
| 33 @property(nonatomic, assign) BOOL promoState; |
| 34 |
| 35 // Registers the feature preferences. |
| 36 + (void)registerBrowserStatePrefs:(user_prefs::PrefRegistrySyncable*)registry; |
| 37 |
| 38 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState |
| 39 delegate: |
| 40 (id<BookmarkPromoControllerDelegate>)delegate; |
| 41 |
| 42 // Presents the sign-in UI. |
| 43 - (void)showSignIn; |
| 44 |
| 45 // Hides the promo cell. It won't be presented again on this profile. |
| 46 - (void)hidePromoCell; |
| 47 |
| 48 // Updates the promo state based on the sign-in state of the user. |
| 49 - (void)updatePromoState; |
| 50 |
| 51 @end |
| 52 |
| 53 #endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_PROMO_CONTROLLER_H_ |
OLD | NEW |