OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/extensions/api/downloads_internal/downloads_internal_ap i.h" | |
6 | |
7 #include "chrome/browser/extensions/api/downloads/downloads_api.h" | |
8 #include "chrome/common/extensions/api/downloads_internal.h" | |
9 | |
10 DownloadsInternalAddFilenameDeterminerFunction:: | |
11 DownloadsInternalAddFilenameDeterminerFunction() {} | |
12 | |
13 DownloadsInternalAddFilenameDeterminerFunction:: | |
14 ~DownloadsInternalAddFilenameDeterminerFunction() {} | |
15 | |
16 typedef extensions::api::downloads_internal::AddFilenameDeterminer::Params | |
17 AddFilenameDeterminerParams; | |
18 | |
19 bool DownloadsInternalAddFilenameDeterminerFunction::RunImpl() { | |
20 scoped_ptr<AddFilenameDeterminerParams> params( | |
21 AddFilenameDeterminerParams::Create(*args_)); | |
22 EXTENSION_FUNCTION_VALIDATE(params.get()); | |
23 return ExtensionDownloadsEventRouter::AddFilenameDeterminer( | |
24 profile(), | |
25 GetExtension()->id(), | |
26 params->sub_event_id); | |
27 } | |
28 | |
29 DownloadsInternalRemoveFilenameDeterminerFunction:: | |
30 DownloadsInternalRemoveFilenameDeterminerFunction() {} | |
31 | |
32 DownloadsInternalRemoveFilenameDeterminerFunction:: | |
33 ~DownloadsInternalRemoveFilenameDeterminerFunction() {} | |
34 | |
35 typedef extensions::api::downloads_internal::RemoveFilenameDeterminer::Params | |
36 RemoveFilenameDeterminerParams; | |
37 | |
38 bool DownloadsInternalRemoveFilenameDeterminerFunction::RunImpl() { | |
Randy Smith (Not in Mondays)
2013/01/22 19:43:08
What is the flow back into the extensions on retur
benjhayden
2013/01/23 21:30:10
The "error_" string is printed in red text in the
| |
39 scoped_ptr<RemoveFilenameDeterminerParams> params( | |
40 RemoveFilenameDeterminerParams::Create(*args_)); | |
41 EXTENSION_FUNCTION_VALIDATE(params.get()); | |
42 return ExtensionDownloadsEventRouter::RemoveFilenameDeterminer( | |
43 profile(), | |
44 GetExtension()->id(), | |
45 params->sub_event_id); | |
46 } | |
47 | |
48 DownloadsInternalDetermineFilenameFunction:: | |
49 DownloadsInternalDetermineFilenameFunction() {} | |
50 | |
51 DownloadsInternalDetermineFilenameFunction:: | |
52 ~DownloadsInternalDetermineFilenameFunction() {} | |
53 | |
54 typedef extensions::api::downloads_internal::DetermineFilename::Params | |
55 DetermineFilenameParams; | |
56 | |
57 bool DownloadsInternalDetermineFilenameFunction::RunImpl() { | |
58 scoped_ptr<DetermineFilenameParams> params( | |
59 DetermineFilenameParams::Create(*args_)); | |
60 EXTENSION_FUNCTION_VALIDATE(params.get()); | |
61 FilePath::StringType filename; | |
62 if (params->filename.get()) { | |
63 EXTENSION_FUNCTION_VALIDATE(args_->GetString(2, &filename)); | |
64 } | |
65 return ExtensionDownloadsEventRouter::DetermineFilename( | |
66 profile(), | |
67 include_incognito(), | |
68 GetExtension()->id(), | |
69 params->sub_event_id, | |
70 params->download_id, | |
71 FilePath(filename), | |
72 params->overwrite); | |
73 } | |
OLD | NEW |