| 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/ui/views/download/download_item_view.h" | 5 #include "chrome/browser/ui/views/download/download_item_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 554 } |
| 555 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", warning_duration); | 555 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", warning_duration); |
| 556 if (model_.ShouldAllowDownloadFeedback() && | 556 if (model_.ShouldAllowDownloadFeedback() && |
| 557 !shelf_->browser()->profile()->IsOffTheRecord()) { | 557 !shelf_->browser()->profile()->IsOffTheRecord()) { |
| 558 if (!shelf_->browser()->profile()->GetPrefs()->HasPrefPath( | 558 if (!shelf_->browser()->profile()->GetPrefs()->HasPrefPath( |
| 559 prefs::kSafeBrowsingExtendedReportingEnabled)) { | 559 prefs::kSafeBrowsingExtendedReportingEnabled)) { |
| 560 // Show dialog, because the dialog hasn't been shown before. | 560 // Show dialog, because the dialog hasn't been shown before. |
| 561 DownloadFeedbackDialogView::Show( | 561 DownloadFeedbackDialogView::Show( |
| 562 shelf_->get_parent()->GetNativeWindow(), | 562 shelf_->get_parent()->GetNativeWindow(), |
| 563 shelf_->browser()->profile(), | 563 shelf_->browser()->profile(), |
| 564 shelf_->GetNavigator(), |
| 564 base::Bind( | 565 base::Bind( |
| 565 &DownloadItemView::PossiblySubmitDownloadToFeedbackService, | 566 &DownloadItemView::PossiblySubmitDownloadToFeedbackService, |
| 566 weak_ptr_factory_.GetWeakPtr())); | 567 weak_ptr_factory_.GetWeakPtr())); |
| 567 } else { | 568 } else { |
| 568 PossiblySubmitDownloadToFeedbackService( | 569 PossiblySubmitDownloadToFeedbackService( |
| 569 shelf_->browser()->profile()->GetPrefs()->GetBoolean( | 570 shelf_->browser()->profile()->GetPrefs()->GetBoolean( |
| 570 prefs::kSafeBrowsingExtendedReportingEnabled)); | 571 prefs::kSafeBrowsingExtendedReportingEnabled)); |
| 571 } | 572 } |
| 572 return; | 573 return; |
| 573 } | 574 } |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 void DownloadItemView::AnimateStateTransition(State from, State to, | 1344 void DownloadItemView::AnimateStateTransition(State from, State to, |
| 1344 gfx::SlideAnimation* animation) { | 1345 gfx::SlideAnimation* animation) { |
| 1345 if (from == NORMAL && to == HOT) { | 1346 if (from == NORMAL && to == HOT) { |
| 1346 animation->Show(); | 1347 animation->Show(); |
| 1347 } else if (from == HOT && to == NORMAL) { | 1348 } else if (from == HOT && to == NORMAL) { |
| 1348 animation->Hide(); | 1349 animation->Hide(); |
| 1349 } else if (from != to) { | 1350 } else if (from != to) { |
| 1350 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1351 animation->Reset((to == HOT) ? 1.0 : 0.0); |
| 1351 } | 1352 } |
| 1352 } | 1353 } |
| OLD | NEW |