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

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

Issue 8451019: Move download extension api implementation to download/ dir. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: aa review Created 9 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/extension_downloads_api_constants.h"
6
7 namespace extension_downloads_api_constants {
8
9 // Error messages
10 const char kNotImplemented[] = "NotImplemented";
11 const char kGenericError[] = "I'm afraid I can't do that.";
12 const char kInvalidURL[] = "Invalid URL";
13
14 // Parameter keys
15 const char kBodyKey[] = "body";
16 const char kBytesReceivedKey[] = "bytesReceived";
17 const char kDangerAcceptedKey[] = "dangerAccepted";
18 const char kDangerFile[] = "file";
19 const char kDangerKey[] = "danger";
20 const char kDangerSafe[] = "safe";
21 const char kDangerUrl[] = "url";
22 const char kEndTimeKey[] = "endTime";
23 const char kErrorKey[] = "error";
24 const char kFileSizeKey[] = "fileSize";
25 const char kFilenameKey[] = "filename";
26 const char kHeaderNameKey[] = "name";
27 const char kHeaderValueKey[] = "value";
28 const char kHeadersKey[] = "headers";
29 const char kIdKey[] = "id";
30 const char kMethodKey[] = "method";
31 const char kMimeKey[] = "mime";
32 const char kPausedKey[] = "paused";
33 const char kSaveAsKey[] = "saveAs";
34 const char kStartTimeKey[] = "startTime";
35 const char kStateComplete[] = "complete";
36 const char kStateInProgress[] = "in_progress";
37 const char kStateInterrupted[] = "interrupted";
38 const char kStateKey[] = "state";
39 const char kTotalBytesKey[] = "totalBytes";
40 const char kUrlKey[] = "url";
41
42 const char* DangerString(DownloadItem::DangerType danger) {
43 switch (danger) {
44 case DownloadItem::NOT_DANGEROUS: return kDangerSafe;
45 case DownloadItem::DANGEROUS_FILE: return kDangerFile;
46 case DownloadItem::DANGEROUS_URL: return kDangerUrl;
47 default:
48 NOTREACHED();
49 return "";
50 }
51 }
52
53 const char* StateString(DownloadItem::DownloadState state) {
54 switch (state) {
55 case DownloadItem::IN_PROGRESS: return kStateInProgress;
56 case DownloadItem::COMPLETE: return kStateComplete;
57 case DownloadItem::INTERRUPTED: // fall through
58 case DownloadItem::CANCELLED: return kStateInterrupted;
59 case DownloadItem::REMOVING: // fall through
60 default:
61 NOTREACHED();
62 return "";
63 }
64 }
65 } // namespace extension_downloads_api_constants
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698