diff options
-rw-r--r-- | chrome/browser/cocoa/download/download_item_mac.h | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/download/download_item_mac.mm | 6 | ||||
-rw-r--r-- | chrome/browser/dom_ui/downloads_dom_handler.cc | 2 | ||||
-rw-r--r-- | chrome/browser/download/download_item.cc | 14 | ||||
-rw-r--r-- | chrome/browser/download/download_item.h | 6 | ||||
-rw-r--r-- | chrome/browser/gtk/download_item_gtk.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/download_item_gtk.h | 4 | ||||
-rw-r--r-- | chrome/browser/ui/views/download_item_view.cc | 6 |
8 files changed, 25 insertions, 25 deletions
diff --git a/chrome/browser/cocoa/download/download_item_mac.h b/chrome/browser/cocoa/download/download_item_mac.h index 1a27549..d31b19d 100644 --- a/chrome/browser/cocoa/download/download_item_mac.h +++ b/chrome/browser/cocoa/download/download_item_mac.h @@ -54,8 +54,8 @@ class DownloadItemMac : DownloadItem::Observer { // For canceling an in progress icon request. CancelableRequestConsumerT<int, 0> icon_consumer_; - // Stores the last known name where the file will be saved. - FilePath lastFileName_; + // Stores the last known path where the file will be saved. + FilePath lastFilePath_; DISALLOW_COPY_AND_ASSIGN(DownloadItemMac); }; diff --git a/chrome/browser/cocoa/download/download_item_mac.mm b/chrome/browser/cocoa/download/download_item_mac.mm index 0f8c5b7..836a041 100644 --- a/chrome/browser/cocoa/download/download_item_mac.mm +++ b/chrome/browser/cocoa/download/download_item_mac.mm @@ -34,12 +34,12 @@ void DownloadItemMac::OnDownloadUpdated(DownloadItem* download) { [item_controller_ clearDangerousMode]; } - if (download->GetUserVerifiedFileName() != lastFileName_) { + if (download->GetUserVerifiedFilePath() != lastFilePath_) { // Turns out the file path is "unconfirmed %d.crdownload" for dangerous // downloads. When the download is confirmed, the file is renamed on // another thread, so reload the icon if the download filename changes. LoadIcon(); - lastFileName_ = download->GetUserVerifiedFileName(); + lastFilePath_ = download->GetUserVerifiedFilePath(); [item_controller_ updateToolTip]; } @@ -72,7 +72,7 @@ void DownloadItemMac::LoadIcon() { } // We may already have this particular image cached. - FilePath file = download_model_->download()->GetUserVerifiedFileName(); + FilePath file = download_model_->download()->GetUserVerifiedFilePath(); SkBitmap* icon_bitmap = icon_manager->LookupIcon(file, IconLoader::SMALL); if (icon_bitmap) { NSImage* icon = gfx::SkBitmapToNSImage(*icon_bitmap); diff --git a/chrome/browser/dom_ui/downloads_dom_handler.cc b/chrome/browser/dom_ui/downloads_dom_handler.cc index e94ac0a..5617d2b 100644 --- a/chrome/browser/dom_ui/downloads_dom_handler.cc +++ b/chrome/browser/dom_ui/downloads_dom_handler.cc @@ -159,7 +159,7 @@ void DownloadsDOMHandler::HandleDrag(const ListValue* args) { DownloadItem* file = GetDownloadByValue(args); if (file) { IconManager* im = g_browser_process->icon_manager(); - SkBitmap* icon = im->LookupIcon(file->GetUserVerifiedFileName(), + SkBitmap* icon = im->LookupIcon(file->GetUserVerifiedFilePath(), IconLoader::NORMAL); gfx::NativeView view = dom_ui_->tab_contents()->GetNativeView(); download_util::DragDownload(file, icon, view); diff --git a/chrome/browser/download/download_item.cc b/chrome/browser/download/download_item.cc index 3781877..886903f 100644 --- a/chrome/browser/download/download_item.cc +++ b/chrome/browser/download/download_item.cc @@ -169,15 +169,15 @@ bool DownloadItem::CanOpenDownload() { bool DownloadItem::ShouldOpenFileBasedOnExtension() { return download_manager_->ShouldOpenFileBasedOnExtension( - GetUserVerifiedFileName()); + GetUserVerifiedFilePath()); } void DownloadItem::OpenFilesBasedOnExtension(bool open) { DownloadPrefs* prefs = download_manager_->download_prefs(); if (open) - prefs->EnableAutoOpenBasedOnExtension(GetUserVerifiedFileName()); + prefs->EnableAutoOpenBasedOnExtension(GetUserVerifiedFilePath()); else - prefs->DisableAutoOpenBasedOnExtension(GetUserVerifiedFileName()); + prefs->DisableAutoOpenBasedOnExtension(GetUserVerifiedFilePath()); } void DownloadItem::OpenDownload() { @@ -277,7 +277,7 @@ void DownloadItem::Finished() { auto_opened_ = true; } else if (open_when_complete() || download_manager_->ShouldOpenFileBasedOnExtension( - GetUserVerifiedFileName()) || + GetUserVerifiedFilePath()) || is_temporary()) { // If the download is temporary, like in drag-and-drop, do not open it but // we still need to set it auto-opened so that it can be removed from the @@ -431,10 +431,10 @@ FilePath DownloadItem::GetFileNameToReportUser() const { return target_name_; } -FilePath DownloadItem::GetUserVerifiedFileName() const { +FilePath DownloadItem::GetUserVerifiedFilePath() const { if (safety_state_ == DownloadItem::SAFE) - return target_name_; - return full_path_.BaseName(); + return GetTargetFilePath(); + return full_path_; } void DownloadItem::Init(bool start_timer) { diff --git a/chrome/browser/download/download_item.h b/chrome/browser/download/download_item.h index a9b736e..942d16a 100644 --- a/chrome/browser/download/download_item.h +++ b/chrome/browser/download/download_item.h @@ -212,10 +212,10 @@ class DownloadItem { // target_name_ possibly with the uniquifier number. FilePath GetFileNameToReportUser() const; - // Returns the user-verified target name for the download. - // This returns the same path as target_name() for safe downloads + // Returns the user-verified target file path for the download. + // This returns the same path as GetTargetFilePath() for safe downloads // but does not for dangerous downloads until the name is verified. - FilePath GetUserVerifiedFileName() const; + FilePath GetUserVerifiedFilePath() const; // Returns true if the current file name is not the final target name yet. bool NeedsRename() const { diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc index 329208b..69f0484 100644 --- a/chrome/browser/gtk/download_item_gtk.cc +++ b/chrome/browser/gtk/download_item_gtk.cc @@ -355,7 +355,7 @@ void DownloadItemGtk::OnDownloadUpdated(DownloadItem* download) { parent_shelf_->MaybeShowMoreDownloadItems(); } - if (download->GetUserVerifiedFileName() != icon_filename_) { + if (download->GetUserVerifiedFilePath() != icon_filepath_) { // Turns out the file path is "unconfirmed %d.crdownload" for dangerous // downloads. When the download is confirmed, the file is renamed on // another thread, so reload the icon if the download filename changes. @@ -510,11 +510,11 @@ void DownloadItemGtk::OnLoadLargeIconComplete(IconManager::Handle handle, void DownloadItemGtk::LoadIcon() { icon_consumer_.CancelAllRequests(); IconManager* im = g_browser_process->icon_manager(); - icon_filename_ = get_download()->GetUserVerifiedFileName(); - im->LoadIcon(icon_filename_, + icon_filepath_ = get_download()->GetUserVerifiedFilePath(); + im->LoadIcon(icon_filepath_, IconLoader::SMALL, &icon_consumer_, NewCallback(this, &DownloadItemGtk::OnLoadSmallIconComplete)); - im->LoadIcon(icon_filename_, + im->LoadIcon(icon_filepath_, IconLoader::LARGE, &icon_consumer_, NewCallback(this, &DownloadItemGtk::OnLoadLargeIconComplete)); } diff --git a/chrome/browser/gtk/download_item_gtk.h b/chrome/browser/gtk/download_item_gtk.h index a9ad27d..8d79080 100644 --- a/chrome/browser/gtk/download_item_gtk.h +++ b/chrome/browser/gtk/download_item_gtk.h @@ -202,8 +202,8 @@ class DownloadItemGtk : public DownloadItem::Observer, SkBitmap* icon_small_; SkBitmap* icon_large_; - // The last download file name for which we requested an icon. - FilePath icon_filename_; + // The last download file path for which we requested an icon. + FilePath icon_filepath_; NotificationRegistrar registrar_; diff --git a/chrome/browser/ui/views/download_item_view.cc b/chrome/browser/ui/views/download_item_view.cc index 7b3e579..1c1e101 100644 --- a/chrome/browser/ui/views/download_item_view.cc +++ b/chrome/browser/ui/views/download_item_view.cc @@ -638,7 +638,7 @@ void DownloadItemView::Paint(gfx::Canvas* canvas) { // Paint the icon. IconManager* im = g_browser_process->icon_manager(); SkBitmap* icon = IsDangerousMode() ? warning_icon_ : - im->LookupIcon(download_->GetUserVerifiedFileName(), IconLoader::SMALL); + im->LookupIcon(download_->GetUserVerifiedFilePath(), IconLoader::SMALL); // We count on the fact that the icon manager will cache the icons and if one // is available, it will be cached here. We *don't* want to request the icon @@ -850,7 +850,7 @@ bool DownloadItemView::OnMouseDragged(const views::MouseEvent& event) { if (dragging_) { if (download_->state() == DownloadItem::COMPLETE) { IconManager* im = g_browser_process->icon_manager(); - SkBitmap* icon = im->LookupIcon(download_->GetUserVerifiedFileName(), + SkBitmap* icon = im->LookupIcon(download_->GetUserVerifiedFilePath(), IconLoader::SMALL); if (icon) { views::Widget* widget = GetWidget(); @@ -961,7 +961,7 @@ void DownloadItemView::OnExtractIconComplete(IconManager::Handle handle, void DownloadItemView::LoadIcon() { IconManager* im = g_browser_process->icon_manager(); - im->LoadIcon(download_->GetUserVerifiedFileName(), + im->LoadIcon(download_->GetUserVerifiedFilePath(), IconLoader::SMALL, &icon_consumer_, NewCallback(this, &DownloadItemView::OnExtractIconComplete)); } |