Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Download utilities. | 5 // Download utilities. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
| 8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/strings/string_util.h" | |
| 16 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 17 | 18 |
| 18 #if defined(TOOLKIT_VIEWS) | 19 #if defined(TOOLKIT_VIEWS) |
| 19 #include "ui/views/view.h" | 20 #include "ui/views/view.h" |
| 20 #endif | 21 #endif |
| 21 | 22 |
| 22 class GURL; | 23 class GURL; |
| 23 | 24 |
| 24 namespace base { | 25 namespace base { |
| 25 class DictionaryValue; | 26 class DictionaryValue; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 | 109 |
| 109 CHROME_DOWNLOAD_SOURCE_LAST_ENTRY, | 110 CHROME_DOWNLOAD_SOURCE_LAST_ENTRY, |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 // Increment one of the above counts. | 113 // Increment one of the above counts. |
| 113 void RecordDownloadCount(ChromeDownloadCountTypes type); | 114 void RecordDownloadCount(ChromeDownloadCountTypes type); |
| 114 | 115 |
| 115 // Record initiation of a download from a specific source. | 116 // Record initiation of a download from a specific source. |
| 116 void RecordDownloadSource(ChromeDownloadSource source); | 117 void RecordDownloadSource(ChromeDownloadSource source); |
| 117 | 118 |
| 119 // Summer/Fall 2013 Finch experiment strings ----------------------------------- | |
| 120 // Only deployed to English speakers, don't need translation. | |
| 121 | |
| 122 // Study and condition names. | |
| 123 const char kFinchTrialName[] = "MalwareDownloadWarning"; | |
|
asanka
2013/08/09 18:50:17
Declare the strings here, and move the definitions
felt
2013/08/09 19:13:15
Done.
| |
| 124 const char kCondition1Control[] = "Condition1Control"; | |
| 125 const char kCondition2Control[] = "Condition2Control"; | |
| 126 const char kCondition3Malicious[] = "Condition3Malicious"; | |
| 127 const char kCondition4Unsafe[] = "Condition4Unsafe"; | |
| 128 const char kCondition5Dangerous[] = "Condition5Dangerous"; | |
| 129 const char kCondition6Harmful[] = "Condition6Harmful"; | |
| 130 const char kCondition7DiscardSecond[] = "Condition7DiscardSecond"; | |
| 131 const char kCondition8DiscardFirst[] = "Condition8DiscardFirst"; | |
| 132 const char kCondition9SafeDiscard[] = "Condition9SafeDiscard"; | |
| 133 const char kCondition10SafeDontRun[] = "Condition10SafeDontRun"; | |
| 134 | |
| 135 // Helper for getting the appropriate message for a Finch trial. | |
| 136 // You should only invoke this if you believe you're in the kFinchTrialName | |
| 137 // finch trial; if you aren't, use the default string and don't invoke this. | |
| 138 string16 AssembleMalwareFinchString(const std::string& trialCondition, | |
| 139 const string16& elided_filename); | |
| 140 | |
| 118 } // namespace download_util | 141 } // namespace download_util |
| 119 | 142 |
| 120 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 143 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
| OLD | NEW |