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

Unified Diff: ios/chrome/browser/ui/bookmarks/bookmark_promo_controller.h

Issue 2586993002: Upstream Chrome on iOS source code [3/11]. (Closed)
Patch Set: Created 4 years 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/bookmarks/bookmark_promo_controller.h
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_promo_controller.h b/ios/chrome/browser/ui/bookmarks/bookmark_promo_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..656088473129a7c8a7c28df5ea6d7a1cd2a33161
--- /dev/null
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_promo_controller.h
@@ -0,0 +1,53 @@
+// Copyright 2014 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_BOOKMARKS_BOOKMARK_PROMO_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_PROMO_CONTROLLER_H_
+
+#import <UIKit/UIKit.h>
+
+namespace ios {
+class ChromeBrowserState;
+} // namespace ios
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+} // namespace user_prefs
+
+@protocol BookmarkPromoControllerDelegate
+
+// Controls the state of the promo.
+- (void)promoStateChanged:(BOOL)promoEnabled;
+
+@end
+
+// This controller manages the display of the promo cell through its delegate
+// and handles displaying the sign-in view controller.
+@interface BookmarkPromoController : NSObject
+
+@property(nonatomic, assign) id<BookmarkPromoControllerDelegate> delegate;
+
+// Holds the current state of the promo. When the promo state change, it will
+// call the promoStateChanged: selector on the delegate.
+@property(nonatomic, assign) BOOL promoState;
+
+// Registers the feature preferences.
++ (void)registerBrowserStatePrefs:(user_prefs::PrefRegistrySyncable*)registry;
+
+- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
+ delegate:
+ (id<BookmarkPromoControllerDelegate>)delegate;
+
+// Presents the sign-in UI.
+- (void)showSignIn;
+
+// Hides the promo cell. It won't be presented again on this profile.
+- (void)hidePromoCell;
+
+// Updates the promo state based on the sign-in state of the user.
+- (void)updatePromoState;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_PROMO_CONTROLLER_H_
« no previous file with comments | « ios/chrome/browser/ui/bookmarks/bookmark_promo_cell.mm ('k') | ios/chrome/browser/ui/bookmarks/bookmark_promo_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698