| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/download/download_item.h" | 5 #include "chrome/browser/download/download_item.h" | 
| 6 | 6 | 
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" | 
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" | 
| 9 #include "base/logging.h" | 9 #include "base/logging.h" | 
| 10 #include "base/timer.h" | 10 #include "base/timer.h" | 
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" | 
| 12 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" | 
| 13 #include "chrome/browser/chrome_thread.h" | 13 #include "chrome/browser/chrome_thread.h" | 
| 14 #include "chrome/browser/download/download_history.h" | 14 #include "chrome/browser/download/download_history.h" | 
| 15 #include "chrome/browser/download/download_manager.h" | 15 #include "chrome/browser/download/download_manager.h" | 
| 16 #include "chrome/browser/download/download_util.h" | 16 #include "chrome/browser/download/download_util.h" | 
| 17 #include "chrome/browser/history/download_types.h" | 17 #include "chrome/browser/history/download_types.h" | 
| 18 #include "chrome/browser/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" | 
| 19 #include "chrome/browser/profile.h" | 19 #include "chrome/browser/profile.h" | 
| 20 #include "chrome/common/extensions/extension.h" | 20 #include "chrome/common/extensions/extension.h" | 
| 21 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" | 
| 22 | 22 | 
| 23 namespace { | 23 namespace { | 
| 24 | 24 | 
| 25 // Update frequency (milliseconds). | 25 // Update frequency (milliseconds). | 
| 26 const int kUpdateTimeMs = 1000; | 26 const int kUpdateTimeMs = 1000; | 
| 27 | 27 | 
| 28 void DeleteDownloadedFile(const FilePath& path) { | 28 void DeleteDownloadedFile(const FilePath& path) { | 
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 342     return name; | 342     return name; | 
| 343   } | 343   } | 
| 344   return original_name_; | 344   return original_name_; | 
| 345 } | 345 } | 
| 346 | 346 | 
| 347 void DownloadItem::Init(bool start_timer) { | 347 void DownloadItem::Init(bool start_timer) { | 
| 348   file_name_ = full_path_.BaseName(); | 348   file_name_ = full_path_.BaseName(); | 
| 349   if (start_timer) | 349   if (start_timer) | 
| 350     StartProgressTimer(); | 350     StartProgressTimer(); | 
| 351 } | 351 } | 
| OLD | NEW | 
|---|