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 "content/browser/download/download_item_impl.h" | 5 #include "content/browser/download/download_item_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 } | 864 } |
865 | 865 |
866 DownloadItem::TargetDisposition DownloadItemImpl::GetTargetDisposition() const { | 866 DownloadItem::TargetDisposition DownloadItemImpl::GetTargetDisposition() const { |
867 return target_disposition_; | 867 return target_disposition_; |
868 } | 868 } |
869 | 869 |
870 void DownloadItemImpl::OnTargetPathDetermined( | 870 void DownloadItemImpl::OnTargetPathDetermined( |
871 const FilePath& target_path, | 871 const FilePath& target_path, |
872 TargetDisposition disposition, | 872 TargetDisposition disposition, |
873 content::DownloadDangerType danger_type) { | 873 content::DownloadDangerType danger_type) { |
874 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. | |
875 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 874 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
876 target_path_ = target_path; | 875 target_path_ = target_path; |
877 target_disposition_ = disposition; | 876 target_disposition_ = disposition; |
| 877 UpdateObservers(); |
| 878 // SetDangerType() may call UpdateObservers() again. |
878 SetDangerType(danger_type); | 879 SetDangerType(danger_type); |
879 } | 880 } |
880 | 881 |
881 void DownloadItemImpl::OnTargetPathSelected(const FilePath& target_path) { | 882 void DownloadItemImpl::OnTargetPathSelected(const FilePath& target_path) { |
882 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 883 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
883 DCHECK_EQ(TARGET_DISPOSITION_PROMPT, target_disposition_); | 884 DCHECK_EQ(TARGET_DISPOSITION_PROMPT, target_disposition_); |
884 target_path_ = target_path; | 885 target_path_ = target_path; |
| 886 UpdateObservers(); |
885 } | 887 } |
886 | 888 |
887 void DownloadItemImpl::OnContentCheckCompleted( | 889 void DownloadItemImpl::OnContentCheckCompleted( |
888 content::DownloadDangerType danger_type) { | 890 content::DownloadDangerType danger_type) { |
889 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. | 891 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. |
890 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 892 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
891 DCHECK(AllDataSaved()); | 893 DCHECK(AllDataSaved()); |
892 SetDangerType(danger_type); | 894 SetDangerType(danger_type); |
893 } | 895 } |
894 | 896 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 std::map<const void*, ExternalData*>::iterator it = | 1188 std::map<const void*, ExternalData*>::iterator it = |
1187 external_data_map_.find(key); | 1189 external_data_map_.find(key); |
1188 | 1190 |
1189 if (it == external_data_map_.end()) { | 1191 if (it == external_data_map_.end()) { |
1190 external_data_map_[key] = data; | 1192 external_data_map_[key] = data; |
1191 } else if (it->second != data) { | 1193 } else if (it->second != data) { |
1192 delete it->second; | 1194 delete it->second; |
1193 it->second = data; | 1195 it->second = data; |
1194 } | 1196 } |
1195 } | 1197 } |
OLD | NEW |