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 <memory> |
8 #include <set> | 9 #include <set> |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/scoped_observer.h" | 14 #include "base/scoped_observer.h" |
14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
15 #include "chrome/browser/download/all_download_item_notifier.h" | 16 #include "chrome/browser/download/all_download_item_notifier.h" |
16 #include "chrome/browser/download/download_danger_prompt.h" | 17 #include "chrome/browser/download/download_danger_prompt.h" |
17 #include "chrome/browser/download/download_path_reservation_tracker.h" | 18 #include "chrome/browser/download/download_path_reservation_tracker.h" |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 }; | 382 }; |
382 | 383 |
383 void CheckForHistoryFilesRemoval(); | 384 void CheckForHistoryFilesRemoval(); |
384 | 385 |
385 private: | 386 private: |
386 void DispatchEvent( | 387 void DispatchEvent( |
387 events::HistogramValue histogram_value, | 388 events::HistogramValue histogram_value, |
388 const std::string& event_name, | 389 const std::string& event_name, |
389 bool include_incognito, | 390 bool include_incognito, |
390 const extensions::Event::WillDispatchCallback& will_dispatch_callback, | 391 const extensions::Event::WillDispatchCallback& will_dispatch_callback, |
391 base::Value* json_arg); | 392 std::unique_ptr<base::Value> json_arg); |
392 | 393 |
393 // extensions::ExtensionRegistryObserver. | 394 // extensions::ExtensionRegistryObserver. |
394 void OnExtensionUnloaded( | 395 void OnExtensionUnloaded( |
395 content::BrowserContext* browser_context, | 396 content::BrowserContext* browser_context, |
396 const extensions::Extension* extension, | 397 const extensions::Extension* extension, |
397 extensions::UnloadedExtensionInfo::Reason reason) override; | 398 extensions::UnloadedExtensionInfo::Reason reason) override; |
398 | 399 |
399 Profile* profile_; | 400 Profile* profile_; |
400 AllDownloadItemNotifier notifier_; | 401 AllDownloadItemNotifier notifier_; |
401 std::set<const extensions::Extension*> shelf_disabling_extensions_; | 402 std::set<const extensions::Extension*> shelf_disabling_extensions_; |
402 | 403 |
403 base::Time last_checked_removal_; | 404 base::Time last_checked_removal_; |
404 | 405 |
405 // Listen to extension unloaded notifications. | 406 // Listen to extension unloaded notifications. |
406 ScopedObserver<extensions::ExtensionRegistry, | 407 ScopedObserver<extensions::ExtensionRegistry, |
407 extensions::ExtensionRegistryObserver> | 408 extensions::ExtensionRegistryObserver> |
408 extension_registry_observer_; | 409 extension_registry_observer_; |
409 | 410 |
410 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); | 411 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); |
411 }; | 412 }; |
412 | 413 |
413 } // namespace extensions | 414 } // namespace extensions |
414 | 415 |
415 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 416 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
OLD | NEW |