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 #ifndef CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
13 #include "chrome/browser/download/all_download_item_notifier.h" | 13 #include "chrome/browser/download/all_download_item_notifier.h" |
14 #include "chrome/browser/download/download_danger_prompt.h" | 14 #include "chrome/browser/download/download_danger_prompt.h" |
15 #include "chrome/browser/download/download_path_reservation_tracker.h" | 15 #include "chrome/browser/download/download_path_reservation_tracker.h" |
16 #include "chrome/browser/extensions/chrome_extension_function.h" | 16 #include "chrome/browser/extensions/chrome_extension_function.h" |
17 #include "chrome/browser/extensions/extension_warning_set.h" | |
18 #include "chrome/common/extensions/api/downloads.h" | 17 #include "chrome/common/extensions/api/downloads.h" |
19 #include "content/public/browser/download_manager.h" | 18 #include "content/public/browser/download_manager.h" |
20 #include "extensions/browser/event_router.h" | 19 #include "extensions/browser/event_router.h" |
21 #include "extensions/browser/extension_registry_observer.h" | 20 #include "extensions/browser/extension_registry_observer.h" |
| 21 #include "extensions/browser/warning_set.h" |
22 | 22 |
23 class DownloadFileIconExtractor; | 23 class DownloadFileIconExtractor; |
24 class DownloadQuery; | 24 class DownloadQuery; |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 class ResourceContext; | 27 class ResourceContext; |
28 class ResourceDispatcherHost; | 28 class ResourceDispatcherHost; |
29 } | 29 } |
30 | 30 |
31 namespace extensions { | 31 namespace extensions { |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 const base::FilePath& filename, | 317 const base::FilePath& filename, |
318 extensions::api::downloads::FilenameConflictAction conflict_action, | 318 extensions::api::downloads::FilenameConflictAction conflict_action, |
319 const std::string& suggesting_extension_id, | 319 const std::string& suggesting_extension_id, |
320 const base::Time& suggesting_install_time, | 320 const base::Time& suggesting_install_time, |
321 const std::string& incumbent_extension_id, | 321 const std::string& incumbent_extension_id, |
322 const base::Time& incumbent_install_time, | 322 const base::Time& incumbent_install_time, |
323 std::string* winner_extension_id, | 323 std::string* winner_extension_id, |
324 base::FilePath* determined_filename, | 324 base::FilePath* determined_filename, |
325 extensions::api::downloads::FilenameConflictAction* | 325 extensions::api::downloads::FilenameConflictAction* |
326 determined_conflict_action, | 326 determined_conflict_action, |
327 extensions::ExtensionWarningSet* warnings); | 327 extensions::WarningSet* warnings); |
328 | 328 |
329 // A downloads.onDeterminingFilename listener has returned. If the extension | 329 // A downloads.onDeterminingFilename listener has returned. If the extension |
330 // wishes to override the download's filename, then |filename| will be | 330 // wishes to override the download's filename, then |filename| will be |
331 // non-empty. |filename| will be interpreted as a relative path, appended to | 331 // non-empty. |filename| will be interpreted as a relative path, appended to |
332 // the default downloads directory. If the extension wishes to overwrite any | 332 // the default downloads directory. If the extension wishes to overwrite any |
333 // existing files, then |overwrite| will be true. Returns true on success, | 333 // existing files, then |overwrite| will be true. Returns true on success, |
334 // false otherwise. | 334 // false otherwise. |
335 static bool DetermineFilename( | 335 static bool DetermineFilename( |
336 Profile* profile, | 336 Profile* profile, |
337 bool include_incognito, | 337 bool include_incognito, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 ScopedObserver<extensions::ExtensionRegistry, | 403 ScopedObserver<extensions::ExtensionRegistry, |
404 extensions::ExtensionRegistryObserver> | 404 extensions::ExtensionRegistryObserver> |
405 extension_registry_observer_; | 405 extension_registry_observer_; |
406 | 406 |
407 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); | 407 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); |
408 }; | 408 }; |
409 | 409 |
410 } // namespace extensions | 410 } // namespace extensions |
411 | 411 |
412 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 412 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
OLD | NEW |