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 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 DownloadsGetFileIconFunction(); | 288 DownloadsGetFileIconFunction(); |
289 bool RunAsync() override; | 289 bool RunAsync() override; |
290 void SetIconExtractorForTesting(DownloadFileIconExtractor* extractor); | 290 void SetIconExtractorForTesting(DownloadFileIconExtractor* extractor); |
291 | 291 |
292 protected: | 292 protected: |
293 ~DownloadsGetFileIconFunction() override; | 293 ~DownloadsGetFileIconFunction() override; |
294 | 294 |
295 private: | 295 private: |
296 void OnIconURLExtracted(const std::string& url); | 296 void OnIconURLExtracted(const std::string& url); |
297 base::FilePath path_; | 297 base::FilePath path_; |
298 scoped_ptr<DownloadFileIconExtractor> icon_extractor_; | 298 std::unique_ptr<DownloadFileIconExtractor> icon_extractor_; |
299 DISALLOW_COPY_AND_ASSIGN(DownloadsGetFileIconFunction); | 299 DISALLOW_COPY_AND_ASSIGN(DownloadsGetFileIconFunction); |
300 }; | 300 }; |
301 | 301 |
302 // Observes a single DownloadManager and many DownloadItems and dispatches | 302 // Observes a single DownloadManager and many DownloadItems and dispatches |
303 // onCreated and onErased events. | 303 // onCreated and onErased events. |
304 class ExtensionDownloadsEventRouter | 304 class ExtensionDownloadsEventRouter |
305 : public extensions::EventRouter::Observer, | 305 : public extensions::EventRouter::Observer, |
306 public extensions::ExtensionRegistryObserver, | 306 public extensions::ExtensionRegistryObserver, |
307 public AllDownloadItemNotifier::Observer { | 307 public AllDownloadItemNotifier::Observer { |
308 public: | 308 public: |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 ScopedObserver<extensions::ExtensionRegistry, | 406 ScopedObserver<extensions::ExtensionRegistry, |
407 extensions::ExtensionRegistryObserver> | 407 extensions::ExtensionRegistryObserver> |
408 extension_registry_observer_; | 408 extension_registry_observer_; |
409 | 409 |
410 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); | 410 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); |
411 }; | 411 }; |
412 | 412 |
413 } // namespace extensions | 413 } // namespace extensions |
414 | 414 |
415 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 415 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
OLD | NEW |