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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 download()->ValidateDangerousDownload(); | 568 download()->ValidateDangerousDownload(); |
569 return; | 569 return; |
570 } | 570 } |
571 | 571 |
572 // WARNING: all end states after this point delete |this|. | 572 // WARNING: all end states after this point delete |this|. |
573 DCHECK_EQ(discard_button_, sender); | 573 DCHECK_EQ(discard_button_, sender); |
574 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", warning_duration); | 574 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", warning_duration); |
575 Profile* profile = shelf_->browser()->profile(); | 575 Profile* profile = shelf_->browser()->profile(); |
576 if (!model_.IsMalicious() && model_.ShouldAllowDownloadFeedback() && | 576 if (!model_.IsMalicious() && model_.ShouldAllowDownloadFeedback() && |
577 !profile->IsOffTheRecord()) { | 577 !profile->IsOffTheRecord()) { |
578 if (!profile->GetPrefs()->HasPrefPath( | 578 if (!safe_browsing::ExtendedReportingPrefExists(*profile->GetPrefs())) { |
579 safe_browsing::GetExtendedReportingPrefName())) { | |
580 // Show dialog, because the dialog hasn't been shown before. | 579 // Show dialog, because the dialog hasn't been shown before. |
581 DownloadFeedbackDialogView::Show( | 580 DownloadFeedbackDialogView::Show( |
582 shelf_->get_parent()->GetNativeWindow(), profile, | 581 shelf_->get_parent()->GetNativeWindow(), profile, |
583 shelf_->GetNavigator(), | 582 shelf_->GetNavigator(), |
584 base::Bind(&DownloadItemView::PossiblySubmitDownloadToFeedbackService, | 583 base::Bind(&DownloadItemView::PossiblySubmitDownloadToFeedbackService, |
585 weak_ptr_factory_.GetWeakPtr())); | 584 weak_ptr_factory_.GetWeakPtr())); |
586 } else { | 585 } else { |
587 PossiblySubmitDownloadToFeedbackService( | 586 PossiblySubmitDownloadToFeedbackService( |
588 safe_browsing::IsExtendedReportingEnabled(*profile->GetPrefs())); | 587 safe_browsing::IsExtendedReportingEnabled(*profile->GetPrefs())); |
589 } | 588 } |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 SchedulePaint(); | 1108 SchedulePaint(); |
1110 } | 1109 } |
1111 | 1110 |
1112 SkColor DownloadItemView::GetTextColor() const { | 1111 SkColor DownloadItemView::GetTextColor() const { |
1113 return GetTextColorForThemeProvider(GetThemeProvider()); | 1112 return GetTextColorForThemeProvider(GetThemeProvider()); |
1114 } | 1113 } |
1115 | 1114 |
1116 SkColor DownloadItemView::GetDimmedTextColor() const { | 1115 SkColor DownloadItemView::GetDimmedTextColor() const { |
1117 return SkColorSetA(GetTextColor(), 0xC7); | 1116 return SkColorSetA(GetTextColor(), 0xC7); |
1118 } | 1117 } |
OLD | NEW |