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

Side by Side Diff: ios/chrome/browser/ui/authentication/signin_promo_view_mediator.h

Issue 2942923002: Implementing sign-in promo histograms for bookmark (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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 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_AUTHENTICATION_SIGNIN_PROMO_VIEW_MEDIATOR_H_ 5 #ifndef IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_PROMO_VIEW_MEDIATOR_H_
6 #define IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_PROMO_VIEW_MEDIATOR_H_ 6 #define IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_PROMO_VIEW_MEDIATOR_H_
7 7
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 9
10 #import "ios/chrome/browser/ui/authentication/signin_promo_view.h" 10 #import "ios/chrome/browser/ui/authentication/signin_promo_view.h"
11 #import "ios/chrome/browser/ui/authentication/signin_promo_view_delegate.h" 11 #import "ios/chrome/browser/ui/authentication/signin_promo_view_delegate.h"
12 12
13 @class ChromeIdentity; 13 @class ChromeIdentity;
14 @class SigninPromoViewConfigurator; 14 @class SigninPromoViewConfigurator;
15 @protocol SigninPromoViewConsumer; 15 @protocol SigninPromoViewConsumer;
16 16
17 namespace ios {
18 class ChromeBrowserState;
19 } // namespace ios
20
17 // Class that monitors the available identities and creates 21 // Class that monitors the available identities and creates
18 // SigninPromoViewConfigurator. This class makes the link between the model and 22 // SigninPromoViewConfigurator. This class makes the link between the model and
19 // the view. The consumer will receive notification if default identity is 23 // the view. The consumer will receive notification if default identity is
20 // changed or updated. 24 // changed or updated.
21 @interface SigninPromoViewMediator : NSObject<SigninPromoViewDelegate> 25 @interface SigninPromoViewMediator : NSObject<SigninPromoViewDelegate>
22 26
23 // Consumer to handle identity update notifications. 27 // Consumer to handle identity update notifications.
24 @property(nonatomic, weak) id<SigninPromoViewConsumer> consumer; 28 @property(nonatomic, weak) id<SigninPromoViewConsumer> consumer;
25 29
26 // Chrome identity used to configure the view in a warm state mode. Otherwise 30 // Chrome identity used to configure the view in a warm state mode. Otherwise
27 // contains nil. 31 // contains nil.
28 @property(nonatomic, readonly, strong) ChromeIdentity* defaultIdentity; 32 @property(nonatomic, readonly, strong) ChromeIdentity* defaultIdentity;
29 33
30 // Access point used to send user action metrics. 34 // Access point used to send user action metrics.
31 @property(nonatomic) signin_metrics::AccessPoint accessPoint; 35 @property(nonatomic) signin_metrics::AccessPoint accessPoint;
32 36
37 // Preference key to count how many time the sign-in promo view is seen.
38 @property(nonatomic) std::string displayedCountPreferenceKey;
39 // Preference key, set to true when the sign-in promo view is seen too much.
40 @property(nonatomic) std::string alreadySeenSigninViewPreferenceKey;
41 // Histogram name to count how many times the signin promo is implicitly
42 // dismissed per impression.
43 @property(nonatomic) std::string dismissalCountHistogramName;
44 // Histogram name to count how many times one of the "sign in" buttons is
45 // clicked per impression.
46 @property(nonatomic) std::string countTilSigninHistogramName;
sdefresne 2017/06/19 09:07:50 Shouldn't this be "countTillSigninHistogramName"?
jlebel 2017/06/19 14:38:12 According to google, both works (it looks like "ti
sdefresne 2017/06/22 12:40:38 Ack. Didn't knew it was an US vs UK english differ
jlebel 2017/06/23 01:24:06 Acknowledged.
47 // Histogram name to counts how many times the explicit "X"-to-close button is
48 // clicked per impression.
49 @property(nonatomic) std::string countTilXHistogramName;
sdefresne 2017/06/19 09:07:50 Shouldn't this be "countTillXHistogramName"?
jlebel 2017/06/19 14:38:12 See above.
50
51 // See -[SigninPromoViewMediator initWithBrowserState:].
52 - (instancetype)init NS_UNAVAILABLE;
53
54 // Initialises with browser state.
55 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
56 NS_DESIGNATED_INITIALIZER;
57
33 - (SigninPromoViewConfigurator*)createConfigurator; 58 - (SigninPromoViewConfigurator*)createConfigurator;
34 59
60 // Increments the "shown" counter used for histograms. Called when the signin
61 // promo view is visible
62 - (void)signinPromoViewVisible;
63
64 // Called when the sign-in promo view is hidden.
65 - (void)signinPromoViewHidden;
66
67 // Called when the sign-in promo view is dismissed.
68 - (void)signinPromoViewDismissed;
69
35 @end 70 @end
36 71
37 #endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_PROMO_VIEW_MEDIATOR_H_ 72 #endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_PROMO_VIEW_MEDIATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698