New issue
Advanced search Search tips

Issue 622834 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Page transition is used incorrectly in DownloadTargetDeterminer

Project Member Reported by asanka@chromium.org, Jun 23 2016

Issue description

DownloadTargetDeterminer partly bases the danger type of a download on the ui::PageTransition type of the navigation that resulted in the download. The test is implemented as:

 if (danger_level == DownloadFileType::ALLOW_ON_USER_GESTURE &&
      (ui::PageTransitionTypeIncludingQualifiersIs(
          download_->GetTransitionType(),
          ui::PAGE_TRANSITION_FROM_ADDRESS_BAR) ||
       (download_->HasUserGesture() && visits == VISITED_REFERRER)))
    return DownloadFileType::NOT_DANGEROUS;

However the ui::PageTransitionTypeIncludingQualifiersIs(..., ui::PAGE_TRANSITION_FROM_ADDRESS_BAR) test is incorrect. PAGE_TRANSITION_FROM_ADDRESS_BAR is a bit mask that is used as a qualifier accompanying the core page transition type.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 5 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1e639fd737e70a09c363d8342c1af3b9d3143280

commit 1e639fd737e70a09c363d8342c1af3b9d3143280
Author: asanka <asanka@chromium.org>
Date: Tue Jul 05 16:40:27 2016

[Downloads] Correctly test page transition when calculating danger level.

One of the heuristics used to minimize spurious dangerous download
warnings is to check if the navigation that resulted in the download was
initiated via the Omnibox. The test was incorrectly checking if a
ui::PageTransition value was equal to PAGE_TRANSITION_FROM_ADDRESS_BAR.
However, PAGE_TRANSITION_FROM_ADDRESS_BAR is a bit mask that can
accompany multiple core page transition types. This CL fixes the code to
correctly check the single bit.

R=pkasting@chromium.org
BUG= 622834 

Review-Url: https://codereview.chromium.org/2090013006
Cr-Commit-Position: refs/heads/master@{#403792}

[modify] https://crrev.com/1e639fd737e70a09c363d8342c1af3b9d3143280/chrome/browser/download/download_target_determiner.cc
[modify] https://crrev.com/1e639fd737e70a09c363d8342c1af3b9d3143280/chrome/browser/download/download_target_determiner_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment