| 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 #include "chrome/browser/extensions/api/downloads/downloads_api.h" | 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 295 |
| 296 class DownloadFileIconExtractorImpl : public DownloadFileIconExtractor { | 296 class DownloadFileIconExtractorImpl : public DownloadFileIconExtractor { |
| 297 public: | 297 public: |
| 298 DownloadFileIconExtractorImpl() {} | 298 DownloadFileIconExtractorImpl() {} |
| 299 | 299 |
| 300 virtual ~DownloadFileIconExtractorImpl() {} | 300 virtual ~DownloadFileIconExtractorImpl() {} |
| 301 | 301 |
| 302 virtual bool ExtractIconURLForPath(const base::FilePath& path, | 302 virtual bool ExtractIconURLForPath(const base::FilePath& path, |
| 303 float scale, | 303 float scale, |
| 304 IconLoader::IconSize icon_size, | 304 IconLoader::IconSize icon_size, |
| 305 IconURLCallback callback) OVERRIDE; | 305 IconURLCallback callback) override; |
| 306 private: | 306 private: |
| 307 void OnIconLoadComplete( | 307 void OnIconLoadComplete( |
| 308 float scale, const IconURLCallback& callback, gfx::Image* icon); | 308 float scale, const IconURLCallback& callback, gfx::Image* icon); |
| 309 | 309 |
| 310 base::CancelableTaskTracker cancelable_task_tracker_; | 310 base::CancelableTaskTracker cancelable_task_tracker_; |
| 311 }; | 311 }; |
| 312 | 312 |
| 313 bool DownloadFileIconExtractorImpl::ExtractIconURLForPath( | 313 bool DownloadFileIconExtractorImpl::ExtractIconURLForPath( |
| 314 const base::FilePath& path, | 314 const base::FilePath& path, |
| 315 float scale, | 315 float scale, |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 | 886 |
| 887 explicit ManagerDestructionObserver(DownloadManager* manager) | 887 explicit ManagerDestructionObserver(DownloadManager* manager) |
| 888 : manager_(manager) { | 888 : manager_(manager) { |
| 889 manager_->AddObserver(this); | 889 manager_->AddObserver(this); |
| 890 } | 890 } |
| 891 | 891 |
| 892 virtual ~ManagerDestructionObserver() { | 892 virtual ~ManagerDestructionObserver() { |
| 893 manager_->RemoveObserver(this); | 893 manager_->RemoveObserver(this); |
| 894 } | 894 } |
| 895 | 895 |
| 896 virtual void ManagerGoingDown(DownloadManager* manager) OVERRIDE { | 896 virtual void ManagerGoingDown(DownloadManager* manager) override { |
| 897 manager_file_existence_last_checked_->erase(manager); | 897 manager_file_existence_last_checked_->erase(manager); |
| 898 if (manager_file_existence_last_checked_->size() == 0) { | 898 if (manager_file_existence_last_checked_->size() == 0) { |
| 899 delete manager_file_existence_last_checked_; | 899 delete manager_file_existence_last_checked_; |
| 900 manager_file_existence_last_checked_ = NULL; | 900 manager_file_existence_last_checked_ = NULL; |
| 901 } | 901 } |
| 902 } | 902 } |
| 903 | 903 |
| 904 void CheckForHistoryFilesRemovalInternal() { | 904 void CheckForHistoryFilesRemovalInternal() { |
| 905 base::Time now(base::Time::Now()); | 905 base::Time now(base::Time::Now()); |
| 906 int delta = now.ToTimeT() - last_checked_.ToTimeT(); | 906 int delta = now.ToTimeT() - last_checked_.ToTimeT(); |
| (...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1931 const Extension* extension, | 1931 const Extension* extension, |
| 1932 UnloadedExtensionInfo::Reason reason) { | 1932 UnloadedExtensionInfo::Reason reason) { |
| 1933 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1933 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1934 std::set<const Extension*>::iterator iter = | 1934 std::set<const Extension*>::iterator iter = |
| 1935 shelf_disabling_extensions_.find(extension); | 1935 shelf_disabling_extensions_.find(extension); |
| 1936 if (iter != shelf_disabling_extensions_.end()) | 1936 if (iter != shelf_disabling_extensions_.end()) |
| 1937 shelf_disabling_extensions_.erase(iter); | 1937 shelf_disabling_extensions_.erase(iter); |
| 1938 } | 1938 } |
| 1939 | 1939 |
| 1940 } // namespace extensions | 1940 } // namespace extensions |
| OLD | NEW |