| Index: chrome/browser/ui/views/download/download_danger_prompt_views.cc
|
| diff --git a/chrome/browser/ui/views/download/download_danger_prompt_views.cc b/chrome/browser/ui/views/download/download_danger_prompt_views.cc
|
| index ef7bbfbb06f7c2abbb1c223fa115c6cfe3418899..199c80cd076222e08fa88f7fc7cfb96b259cb63c 100644
|
| --- a/chrome/browser/ui/views/download/download_danger_prompt_views.cc
|
| +++ b/chrome/browser/ui/views/download/download_danger_prompt_views.cc
|
| @@ -1,9 +1,9 @@
|
| // Copyright 2013 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
| +#include "chrome/browser/download/download_danger_prompt.h"
|
|
|
| #include "base/compiler_specific.h"
|
| -#include "chrome/browser/download/download_danger_prompt.h"
|
| #include "chrome/browser/download/download_stats.h"
|
| #include "chrome/browser/extensions/api/experience_sampling_private/experience_sampling.h"
|
| #include "chrome/grit/chromium_strings.h"
|
| @@ -41,7 +41,8 @@ class DownloadDangerPromptViews : public DownloadDangerPrompt,
|
| const OnDone& done);
|
|
|
| // DownloadDangerPrompt methods:
|
| - void InvokeActionForTesting(Action action) override;
|
| + std::string InvokeActionForTesting(Action action,
|
| + const GURL& url) override;
|
|
|
| // views::DialogDelegate methods:
|
| base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
|
| @@ -132,7 +133,8 @@ DownloadDangerPromptViews::DownloadDangerPromptViews(
|
| }
|
|
|
| // DownloadDangerPrompt methods:
|
| -void DownloadDangerPromptViews::InvokeActionForTesting(Action action) {
|
| +std::string DownloadDangerPromptViews::InvokeActionForTesting(
|
| + Action action, const GURL& url) {
|
| switch (action) {
|
| case ACCEPT:
|
| Accept();
|
| @@ -147,6 +149,8 @@ void DownloadDangerPromptViews::InvokeActionForTesting(Action action) {
|
| NOTREACHED();
|
| break;
|
| }
|
| +
|
| + return CreateSafeBrowsingDownloadRecoveryReport(action == ACCEPT, url);
|
| }
|
|
|
| // views::DialogDelegate methods:
|
| @@ -333,6 +337,12 @@ void DownloadDangerPromptViews::RunDone(Action action) {
|
| OnDone done = done_;
|
| done_.Reset();
|
| if (download_ != NULL) {
|
| + if (!download_->GetURL().is_empty()) {
|
| + std::string report = CreateSafeBrowsingDownloadRecoveryReport(
|
| + action == DownloadDangerPrompt::ACCEPT, download_->GetURL());
|
| + if (!report.empty())
|
| + SendSerializedReport(report);
|
| + }
|
| download_->RemoveObserver(this);
|
| download_ = NULL;
|
| }
|
|
|