OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_APP_APPLICATION_DELEGATE_METRICS_MEDIATOR_H_ | 5 #ifndef IOS_CHROME_APP_APPLICATION_DELEGATE_METRICS_MEDIATOR_H_ |
6 #define IOS_CHROME_APP_APPLICATION_DELEGATE_METRICS_MEDIATOR_H_ | 6 #define IOS_CHROME_APP_APPLICATION_DELEGATE_METRICS_MEDIATOR_H_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 @protocol StartupInformation; | 10 @protocol StartupInformation; |
(...skipping 10 matching lines...) Expand all Loading... |
21 // Deals with metrics, checking and updating them accordingly to to the user | 21 // Deals with metrics, checking and updating them accordingly to to the user |
22 // preferences. | 22 // preferences. |
23 @interface MetricsMediator : NSObject | 23 @interface MetricsMediator : NSObject |
24 // Returns YES if the metrics pref is enabled. Does not take into account the | 24 // Returns YES if the metrics pref is enabled. Does not take into account the |
25 // wifi-only option or wwan state. | 25 // wifi-only option or wwan state. |
26 - (BOOL)areMetricsEnabled; | 26 - (BOOL)areMetricsEnabled; |
27 // Return YES if uploading is allowed, based on user preferences. | 27 // Return YES if uploading is allowed, based on user preferences. |
28 - (BOOL)isUploadingEnabled; | 28 - (BOOL)isUploadingEnabled; |
29 // Starts or stops the metrics service and crash report recording and/or | 29 // Starts or stops the metrics service and crash report recording and/or |
30 // uploading, based on the current user preferences. Makes sure helper | 30 // uploading, based on the current user preferences. Makes sure helper |
31 // mechanisms and the wwan state observer are set up if necessary. Called both | 31 // mechanisms and the wwan state observer are set up if necessary. Must be |
32 // on initialization and after user triggered preference change. | 32 // called both on initialization and after user triggered preference change. |
33 // |isUserTriggered| is used to distinguish between those cases. | 33 // |isUserTriggered| is used to distinguish between those cases. |
34 - (void)updateMetricsStateBasedOnPrefsUserTriggered:(BOOL)isUserTriggered; | 34 - (void)updateMetricsStateBasedOnPrefsUserTriggered:(BOOL)isUserTriggered; |
35 // Logs the duration of the cold start startup. Does nothing if there isn't a | 35 // Logs the duration of the cold start startup. Does nothing if there isn't a |
36 // cold start. | 36 // cold start. |
37 + (void)logStartupDuration:(id<StartupInformation>)startupInformation; | 37 + (void)logStartupDuration:(id<StartupInformation>)startupInformation; |
38 // Logs the number of tabs open and the start type. | 38 // Logs the number of tabs open and the start type. |
39 + (void)logLaunchMetricsWithStartupInformation: | 39 + (void)logLaunchMetricsWithStartupInformation: |
40 (id<StartupInformation>)startupInformation | 40 (id<StartupInformation>)startupInformation |
41 browserViewInformation: | 41 browserViewInformation: |
42 (id<BrowserViewInformation>)browserViewInformation; | 42 (id<BrowserViewInformation>)browserViewInformation; |
43 // Logs in UserDefaults the current date with kAppEnteredBackgroundDateKey as | 43 // Logs in UserDefaults the current date with kAppEnteredBackgroundDateKey as |
44 // key. | 44 // key. |
45 + (void)logDateInUserDefaults; | 45 + (void)logDateInUserDefaults; |
46 // Disables reporting in breakpad and metrics service. | 46 // Disables reporting in breakpad and metrics service. |
47 + (void)disableReporting; | 47 + (void)disableReporting; |
48 // Logs that the application is in background and the number of memory warnings | 48 // Logs that the application is in background and the number of memory warnings |
49 // for this session. | 49 // for this session. |
50 + (void)applicationDidEnterBackground:(NSInteger)memoryWarningCount; | 50 + (void)applicationDidEnterBackground:(NSInteger)memoryWarningCount; |
51 | 51 |
52 @end | 52 @end |
53 | 53 |
54 #endif // IOS_CHROME_APP_APPLICATION_DELEGATE_METRICS_MEDIATOR_H_ | 54 #endif // IOS_CHROME_APP_APPLICATION_DELEGATE_METRICS_MEDIATOR_H_ |
OLD | NEW |