OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_SHELL_BROWSER_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ |
6 #define CONTENT_SHELL_BROWSER_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ | 6 #define CONTENT_SHELL_BROWSER_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
9 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" |
10 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
11 #include "content/public/browser/download_manager_delegate.h" | 14 #include "content/public/browser/download_manager_delegate.h" |
12 | 15 |
13 namespace content { | 16 namespace content { |
14 | 17 |
15 class DownloadManager; | 18 class DownloadManager; |
16 | 19 |
17 class ShellDownloadManagerDelegate : public DownloadManagerDelegate { | 20 class ShellDownloadManagerDelegate : public DownloadManagerDelegate { |
18 public: | 21 public: |
19 ShellDownloadManagerDelegate(); | 22 ShellDownloadManagerDelegate(); |
(...skipping 17 matching lines...) Expand all Loading... |
37 | 40 |
38 typedef base::Callback<void(const base::FilePath&)> | 41 typedef base::Callback<void(const base::FilePath&)> |
39 FilenameDeterminedCallback; | 42 FilenameDeterminedCallback; |
40 | 43 |
41 static void GenerateFilename(const GURL& url, | 44 static void GenerateFilename(const GURL& url, |
42 const std::string& content_disposition, | 45 const std::string& content_disposition, |
43 const std::string& suggested_filename, | 46 const std::string& suggested_filename, |
44 const std::string& mime_type, | 47 const std::string& mime_type, |
45 const base::FilePath& suggested_directory, | 48 const base::FilePath& suggested_directory, |
46 const FilenameDeterminedCallback& callback); | 49 const FilenameDeterminedCallback& callback); |
47 void OnDownloadPathGenerated(uint32 download_id, | 50 void OnDownloadPathGenerated(uint32_t download_id, |
48 const DownloadTargetCallback& callback, | 51 const DownloadTargetCallback& callback, |
49 const base::FilePath& suggested_path); | 52 const base::FilePath& suggested_path); |
50 void ChooseDownloadPath(uint32 download_id, | 53 void ChooseDownloadPath(uint32_t download_id, |
51 const DownloadTargetCallback& callback, | 54 const DownloadTargetCallback& callback, |
52 const base::FilePath& suggested_path); | 55 const base::FilePath& suggested_path); |
53 | 56 |
54 DownloadManager* download_manager_; | 57 DownloadManager* download_manager_; |
55 base::FilePath default_download_path_; | 58 base::FilePath default_download_path_; |
56 bool suppress_prompting_; | 59 bool suppress_prompting_; |
57 base::WeakPtrFactory<ShellDownloadManagerDelegate> weak_ptr_factory_; | 60 base::WeakPtrFactory<ShellDownloadManagerDelegate> weak_ptr_factory_; |
58 | 61 |
59 DISALLOW_COPY_AND_ASSIGN(ShellDownloadManagerDelegate); | 62 DISALLOW_COPY_AND_ASSIGN(ShellDownloadManagerDelegate); |
60 }; | 63 }; |
61 | 64 |
62 } // namespace content | 65 } // namespace content |
63 | 66 |
64 #endif // CONTENT_SHELL_BROWSER_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ | 67 #endif // CONTENT_SHELL_BROWSER_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |