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_FIRST_RUN_FIRST_RUN_UTIL_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_FIRST_RUN_FIRST_RUN_UTIL_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 @class FirstRunConfiguration; |
| 11 @class Tab; |
| 12 |
| 13 namespace base { |
| 14 class TimeTicks; |
| 15 } |
| 16 |
| 17 namespace ios { |
| 18 class ChromeBrowserState; |
| 19 } |
| 20 |
| 21 // Notification sent when the first run ends, right before dimissing the Terms |
| 22 // of Service modal view. |
| 23 extern NSString* const kChromeFirstRunUIWillFinishNotification; |
| 24 |
| 25 // Notification sent when the first run has finished and has dismissed the Terms |
| 26 // of Service modal view. |
| 27 extern NSString* const kChromeFirstRunUIDidFinishNotification; |
| 28 |
| 29 namespace ios_internal { |
| 30 |
| 31 // Checks if the last line of the label only contains one word and if so, insert |
| 32 // a newline character before the second to last word so that there are two |
| 33 // words on the last line. Should only be called on labels that span multiple |
| 34 // lines. Returns YES if a newline was added. |
| 35 BOOL FixOrphanWord(UILabel* label); |
| 36 |
| 37 // Creates the First Run sentinel file so that the user will not be shown First |
| 38 // Run on subsequent cold starts. The user is considered done with First Run |
| 39 // only after a successful sign-in or explicitly skipping signing in. First Run |
| 40 // metrics are recorded iff the sentinel file didn't previous exist and was |
| 41 // successfully created. |
| 42 void WriteFirstRunSentinelAndRecordMetrics( |
| 43 ios::ChromeBrowserState* browserState, |
| 44 BOOL sign_in_attempted, |
| 45 BOOL has_sso_account); |
| 46 |
| 47 // Methods for writing sentinel and recording metrics and posting notifications |
| 48 void FinishFirstRun(ios::ChromeBrowserState* browserState, |
| 49 Tab* tab, |
| 50 FirstRunConfiguration* config); |
| 51 |
| 52 // Records Product tour timing metrics using histogram. |
| 53 void RecordProductTourTimingMetrics(NSString* timer_name, |
| 54 base::TimeTicks start_time); |
| 55 |
| 56 // Posts a notification that First Run did finish. |
| 57 void FirstRunDismissed(); |
| 58 |
| 59 // Enables or disables the data reduction proxy and also sets a key indicating |
| 60 // application is using Data Reduction Proxy. |
| 61 void SetDataReductionProxyEnabled(ios::ChromeBrowserState* browserState, |
| 62 BOOL enabled, |
| 63 BOOL toggled_switch); |
| 64 |
| 65 } // namespace ios_internal |
| 66 |
| 67 #endif // IOS_CHROME_BROWSER_UI_FIRST_RUN_FIRST_RUN_UTIL_H_ |
OLD | NEW |