| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SRT_FIELD_TRIAL_WIN_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SRT_FIELD_TRIAL_WIN_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SRT_FIELD_TRIAL_WIN_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SRT_FIELD_TRIAL_WIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| 11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
| 12 | 12 |
| 13 namespace safe_browsing { | 13 namespace safe_browsing { |
| 14 | 14 |
| 15 // These values are used to send UMA information and are replicated in the | 15 // These values are used to send UMA information and are replicated in the |
| 16 // histograms.xml file, so the order MUST NOT CHANGE. | 16 // histograms.xml file, so the order MUST NOT CHANGE. |
| 17 enum SRTPromptHistogramValue { | 17 enum SRTPromptHistogramValue { |
| 18 SRT_PROMPT_SHOWN = 0, | 18 SRT_PROMPT_SHOWN = 0, |
| 19 SRT_PROMPT_ACCEPTED = 1, | 19 SRT_PROMPT_ACCEPTED = 1, |
| 20 SRT_PROMPT_DENIED = 2, | 20 SRT_PROMPT_DENIED = 2, |
| 21 SRT_PROMPT_FALLBACK = 3, | 21 SRT_PROMPT_FALLBACK = 3, |
| 22 SRT_PROMPT_DOWNLOAD_UNAVAILABLE = 4, | 22 SRT_PROMPT_DOWNLOAD_UNAVAILABLE = 4, |
| 23 SRT_PROMPT_CLOSED = 5, | 23 SRT_PROMPT_CLOSED = 5, |
| 24 SRT_PROMPT_SHOWN_FROM_MENU = 6, | 24 SRT_PROMPT_SHOWN_FROM_MENU = 6, |
| 25 | 25 |
| 26 SRT_PROMPT_MAX, | 26 SRT_PROMPT_MAX, |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // These values are used to send UMA information and are replicated in the |
| 30 // histograms.xml file, so the order MUST NOT CHANGE. |
| 31 enum NoPromptReasonHistogramValue { |
| 32 NO_PROMPT_REASON_BEHAVIOUR_NOT_SUPPORTED = 0, |
| 33 NO_PROMPT_REASON_FEATURE_NOT_ENABLED = 1, |
| 34 NO_PROMPT_REASON_NOTHING_FOUND = 2, |
| 35 NO_PROMPT_REASON_ALREADY_PROMPTED = 3, |
| 36 NO_PROMPT_REASON_RECENTLY_PROMPTED = 4, |
| 37 NO_PROMPT_REASON_CLEANER_DOWNLOAD_FAILED = 5, |
| 38 NO_PROMPT_REASON_BROWSER_NOT_AVAILABLE = 6, |
| 39 NO_PROMPT_REASON_NOT_ON_IDLE_STATE = 7, |
| 40 NO_PROMPT_REASON_IPC_CONNECTION_BROKEN = 8, |
| 41 |
| 42 NO_PROMPT_REASON_MAX, |
| 43 }; |
| 44 |
| 29 // When enabled, all user interaction with the Chrome Cleaner will happen from | 45 // When enabled, all user interaction with the Chrome Cleaner will happen from |
| 30 // within Chrome. | 46 // within Chrome. |
| 31 extern const base::Feature kInBrowserCleanerUIFeature; | 47 extern const base::Feature kInBrowserCleanerUIFeature; |
| 32 | 48 |
| 33 // Returns true if this Chrome is in a field trial group which shows the SRT | 49 // Returns true if this Chrome is in a field trial group which shows the SRT |
| 34 // prompt. | 50 // prompt. |
| 35 bool IsInSRTPromptFieldTrialGroups(); | 51 bool IsInSRTPromptFieldTrialGroups(); |
| 36 | 52 |
| 37 // Returns true if this Chrome is in a field trial group which doesn't need an | 53 // Returns true if this Chrome is in a field trial group which doesn't need an |
| 38 // elevation icon, i.e., the SRT won't ask for elevation on startup. | 54 // elevation icon, i.e., the SRT won't ask for elevation on startup. |
| 39 bool SRTPromptNeedsElevationIcon(); | 55 bool SRTPromptNeedsElevationIcon(); |
| 40 | 56 |
| 41 // Returns true if this Chrome is in a field trial group which enables running | 57 // Returns true if this Chrome is in a field trial group which enables running |
| 42 // the SwReporter. | 58 // the SwReporter. |
| 43 bool IsSwReporterEnabled(); | 59 bool IsSwReporterEnabled(); |
| 44 | 60 |
| 45 // Returns the correct SRT download URL for the current field trial. | 61 // Returns the correct SRT download URL for the current field trial. |
| 46 GURL GetSRTDownloadURL(); | 62 GURL GetSRTDownloadURL(); |
| 47 | 63 |
| 48 // Returns the value of the incoming SRT seed. | 64 // Returns the value of the incoming SRT seed. |
| 49 std::string GetIncomingSRTSeed(); | 65 std::string GetIncomingSRTSeed(); |
| 50 | 66 |
| 51 // Records a value for the SRT Prompt Histogram. | 67 // Records a value for the SRT Prompt Histogram. |
| 52 void RecordSRTPromptHistogram(SRTPromptHistogramValue value); | 68 void RecordSRTPromptHistogram(SRTPromptHistogramValue value); |
| 53 | 69 |
| 70 // Records a SoftwareReporter.PromptShown histogram with value true. |
| 71 void RecordPromptShownHistogram(); |
| 72 |
| 73 // Records a SoftwareReporter.PromptShown histogram with value false and |
| 74 // a SoftwareReporter.NoPromptReason histogram with the reason corresponding |
| 75 // to |value|. |
| 76 void RecordPromptNotShownWithReasonHistogram( |
| 77 NoPromptReasonHistogramValue value); |
| 78 |
| 54 } // namespace safe_browsing | 79 } // namespace safe_browsing |
| 55 | 80 |
| 56 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SRT_FIELD_TRIAL_WIN_H_ | 81 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SRT_FIELD_TRIAL_WIN_H_ |
| OLD | NEW |