Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1207)

Side by Side Diff: chrome/browser/extensions/extension_downloads_api_constants.cc

Issue 7825035: Implement chrome.experimental.downloads.search() (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: " Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extension_downloads_api_constants.h" 5 #include "chrome/browser/extensions/extension_downloads_api_constants.h"
6 6
7 namespace extension_downloads_api_constants { 7 namespace extension_downloads_api_constants {
8 8
9 // Error messages 9 // Error messages
10 const char kNotImplemented[] = "NotImplemented"; 10 const char kNotImplemented[] = "NotImplemented";
11 const char kGenericError[] = "I'm afraid I can't do that."; 11 const char kGenericError[] = "I'm afraid I can't do that.";
12 const char kInvalidURL[] = "Invalid URL"; 12 const char kInvalidURL[] = "Invalid URL";
13 13
14 // Parameter keys 14 // Parameter keys
15 const char kBodyKey[] = "body"; 15 const char kBodyKey[] = "body";
16 const char kBytesReceivedKey[] = "bytesReceived"; 16 const char kBytesReceivedKey[] = "bytesReceived";
17 const char kDangerAcceptedKey[] = "dangerAccepted"; 17 const char kDangerAcceptedKey[] = "dangerAccepted";
18 const char kDangerFile[] = "file"; 18 const char kDangerFile[] = "file";
19 const char kDangerKey[] = "danger"; 19 const char kDangerKey[] = "danger";
20 const char kDangerSafe[] = "safe"; 20 const char kDangerSafe[] = "safe";
21 const char kDangerUrl[] = "url"; 21 const char kDangerUrl[] = "url";
22 const char kEndTimeKey[] = "endTime"; 22 const char kEndTimeKey[] = "endTime";
23 const char kEndedAfterKey[] = "endedAfter";
24 const char kEndedBeforeKey[] = "endedBefore";
23 const char kErrorKey[] = "error"; 25 const char kErrorKey[] = "error";
24 const char kFileSizeKey[] = "fileSize"; 26 const char kFileSizeKey[] = "fileSize";
25 const char kFilenameKey[] = "filename"; 27 const char kFilenameKey[] = "filename";
28 const char kFilenameRegexKey[] = "filenameRegex";
26 const char kHeaderNameKey[] = "name"; 29 const char kHeaderNameKey[] = "name";
27 const char kHeaderValueKey[] = "value"; 30 const char kHeaderValueKey[] = "value";
28 const char kHeadersKey[] = "headers"; 31 const char kHeadersKey[] = "headers";
29 const char kIdKey[] = "id"; 32 const char kIdKey[] = "id";
33 const char kLimitKey[] = "limit";
30 const char kMethodKey[] = "method"; 34 const char kMethodKey[] = "method";
31 const char kMimeKey[] = "mime"; 35 const char kMimeKey[] = "mime";
36 const char kOrderByKey[] = "orderBy";
32 const char kPausedKey[] = "paused"; 37 const char kPausedKey[] = "paused";
38 const char kQueryKey[] = "query";
33 const char kSaveAsKey[] = "saveAs"; 39 const char kSaveAsKey[] = "saveAs";
34 const char kStartTimeKey[] = "startTime"; 40 const char kStartTimeKey[] = "startTime";
41 const char kStartedAfterKey[] = "startedAfter";
42 const char kStartedBeforeKey[] = "startedBefore";
35 const char kStateComplete[] = "complete"; 43 const char kStateComplete[] = "complete";
36 const char kStateInProgress[] = "in_progress"; 44 const char kStateInProgress[] = "in_progress";
37 const char kStateInterrupted[] = "interrupted"; 45 const char kStateInterrupted[] = "interrupted";
38 const char kStateKey[] = "state"; 46 const char kStateKey[] = "state";
47 const char kTotalBytesGreaterKey[] = "totalBytesGreater";
39 const char kTotalBytesKey[] = "totalBytes"; 48 const char kTotalBytesKey[] = "totalBytes";
49 const char kTotalBytesLessKey[] = "totalBytesLess";
40 const char kUrlKey[] = "url"; 50 const char kUrlKey[] = "url";
51 const char kUrlRegexKey[] = "urlRegex";
41 52
42 const char* DangerString(DownloadItem::DangerType danger) { 53 const char* DangerString(DownloadItem::DangerType danger) {
43 switch (danger) { 54 switch (danger) {
44 case DownloadItem::NOT_DANGEROUS: return kDangerSafe; 55 case DownloadItem::NOT_DANGEROUS: return kDangerSafe;
45 case DownloadItem::DANGEROUS_FILE: return kDangerFile; 56 case DownloadItem::DANGEROUS_FILE: return kDangerFile;
46 case DownloadItem::DANGEROUS_URL: return kDangerUrl; 57 case DownloadItem::DANGEROUS_URL: return kDangerUrl;
47 default: 58 default:
48 NOTREACHED(); 59 NOTREACHED();
49 return ""; 60 return "";
50 } 61 }
51 } 62 }
52 63
53 const char* StateString(DownloadItem::DownloadState state) { 64 const char* StateString(DownloadItem::DownloadState state) {
54 switch (state) { 65 switch (state) {
55 case DownloadItem::IN_PROGRESS: return kStateInProgress; 66 case DownloadItem::IN_PROGRESS: return kStateInProgress;
56 case DownloadItem::COMPLETE: return kStateComplete; 67 case DownloadItem::COMPLETE: return kStateComplete;
57 case DownloadItem::INTERRUPTED: // fall through 68 case DownloadItem::INTERRUPTED: // fall through
58 case DownloadItem::CANCELLED: return kStateInterrupted; 69 case DownloadItem::CANCELLED: return kStateInterrupted;
59 case DownloadItem::REMOVING: // fall through 70 case DownloadItem::REMOVING: // fall through
60 default: 71 default:
61 NOTREACHED(); 72 NOTREACHED();
62 return ""; 73 return "";
63 } 74 }
64 } 75 }
65 } // namespace extension_downloads_api_constants 76 } // namespace extension_downloads_api_constants
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698