 Chromium Code Reviews
 Chromium Code Reviews Issue 6324020:
  Tweak the auto-open algorithm to permit JNLP to auto-open iff the user has...  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src/
    
  
    Issue 6324020:
  Tweak the auto-open algorithm to permit JNLP to auto-open iff the user has...  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src/| Index: chrome/browser/download/download_util.cc | 
| =================================================================== | 
| --- chrome/browser/download/download_util.cc (revision 72765) | 
| +++ chrome/browser/download/download_util.cc (working copy) | 
| @@ -762,11 +762,14 @@ | 
| } | 
| // TODO(erikkay,phajdan.jr): This is apparently not being exercised in tests. | 
| -bool IsDangerous(DownloadCreateInfo* info, Profile* profile) { | 
| +bool IsDangerous(DownloadCreateInfo* info, Profile* profile, bool auto_open) { | 
| DownloadDangerLevel danger_level = GetFileDangerLevel( | 
| info->suggested_path.BaseName()); | 
| if (danger_level == Dangerous) { | 
| + if (auto_open && info->has_user_gesture) { | 
| 
Peter Kasting
2011/01/28 23:51:25
Two nits:
* Can condense this whole block to "ret
 | 
| + return false; | 
| + } | 
| return true; | 
| } else if (danger_level == AllowOnUserGesture && !info->has_user_gesture) { | 
| return true; |