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 #include "chrome/browser/extensions/api/downloads/downloads_api.h" | 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cctype> | 8 #include <cctype> |
9 #include <iterator> | 9 #include <iterator> |
10 #include <set> | 10 #include <set> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 const int kDefaultIconSize = 32; | 99 const int kDefaultIconSize = 32; |
100 | 100 |
101 // Parameter keys | 101 // Parameter keys |
102 const char kBytesReceivedKey[] = "bytesReceived"; | 102 const char kBytesReceivedKey[] = "bytesReceived"; |
103 const char kDangerAcceptedKey[] = "dangerAccepted"; | 103 const char kDangerAcceptedKey[] = "dangerAccepted"; |
104 const char kDangerContent[] = "content"; | 104 const char kDangerContent[] = "content"; |
105 const char kDangerFile[] = "file"; | 105 const char kDangerFile[] = "file"; |
106 const char kDangerKey[] = "danger"; | 106 const char kDangerKey[] = "danger"; |
107 const char kDangerSafe[] = "safe"; | 107 const char kDangerSafe[] = "safe"; |
108 const char kDangerUncommon[] = "uncommon"; | 108 const char kDangerUncommon[] = "uncommon"; |
| 109 const char kDangerUnwanted[] = "unwanted"; |
109 const char kDangerAccepted[] = "accepted"; | 110 const char kDangerAccepted[] = "accepted"; |
110 const char kDangerHost[] = "host"; | 111 const char kDangerHost[] = "host"; |
111 const char kDangerUrl[] = "url"; | 112 const char kDangerUrl[] = "url"; |
112 const char kEndTimeKey[] = "endTime"; | 113 const char kEndTimeKey[] = "endTime"; |
113 const char kEndedAfterKey[] = "endedAfter"; | 114 const char kEndedAfterKey[] = "endedAfter"; |
114 const char kEndedBeforeKey[] = "endedBefore"; | 115 const char kEndedBeforeKey[] = "endedBefore"; |
115 const char kErrorKey[] = "error"; | 116 const char kErrorKey[] = "error"; |
116 const char kExistsKey[] = "exists"; | 117 const char kExistsKey[] = "exists"; |
117 const char kFileSizeKey[] = "fileSize"; | 118 const char kFileSizeKey[] = "fileSize"; |
118 const char kFilenameKey[] = "filename"; | 119 const char kFilenameKey[] = "filename"; |
(...skipping 20 matching lines...) Expand all Loading... |
139 // corresponding change to downloads.json. | 140 // corresponding change to downloads.json. |
140 const char* kDangerStrings[] = { | 141 const char* kDangerStrings[] = { |
141 kDangerSafe, | 142 kDangerSafe, |
142 kDangerFile, | 143 kDangerFile, |
143 kDangerUrl, | 144 kDangerUrl, |
144 kDangerContent, | 145 kDangerContent, |
145 kDangerSafe, | 146 kDangerSafe, |
146 kDangerUncommon, | 147 kDangerUncommon, |
147 kDangerAccepted, | 148 kDangerAccepted, |
148 kDangerHost, | 149 kDangerHost, |
| 150 kDangerUnwanted |
149 }; | 151 }; |
150 COMPILE_ASSERT(arraysize(kDangerStrings) == content::DOWNLOAD_DANGER_TYPE_MAX, | 152 COMPILE_ASSERT(arraysize(kDangerStrings) == content::DOWNLOAD_DANGER_TYPE_MAX, |
151 download_danger_type_enum_changed); | 153 download_danger_type_enum_changed); |
152 | 154 |
153 // Note: Any change to the state strings, should be accompanied by a | 155 // Note: Any change to the state strings, should be accompanied by a |
154 // corresponding change to downloads.json. | 156 // corresponding change to downloads.json. |
155 const char* kStateStrings[] = { | 157 const char* kStateStrings[] = { |
156 kStateInProgress, | 158 kStateInProgress, |
157 kStateComplete, | 159 kStateComplete, |
158 kStateInterrupted, | 160 kStateInterrupted, |
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 DownloadsNotificationSource notification_source; | 1503 DownloadsNotificationSource notification_source; |
1502 notification_source.event_name = event_name; | 1504 notification_source.event_name = event_name; |
1503 notification_source.profile = profile_; | 1505 notification_source.profile = profile_; |
1504 content::Source<DownloadsNotificationSource> content_source( | 1506 content::Source<DownloadsNotificationSource> content_source( |
1505 ¬ification_source); | 1507 ¬ification_source); |
1506 content::NotificationService::current()->Notify( | 1508 content::NotificationService::current()->Notify( |
1507 chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT, | 1509 chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT, |
1508 content_source, | 1510 content_source, |
1509 content::Details<std::string>(&json_args)); | 1511 content::Details<std::string>(&json_args)); |
1510 } | 1512 } |
OLD | NEW |