diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-05 23:36:01 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-05 23:36:01 +0000 |
commit | 345e1b89c38bf19ebce483ae5392474bbf63ae59 (patch) | |
tree | 63f2e61cecbf1f28b876d21c3b8d6e4433220805 /chrome/browser/views | |
parent | 6ee68ee792e95e2460ac1f52162f6762944d5239 (diff) | |
download | chromium_src-345e1b89c38bf19ebce483ae5392474bbf63ae59.zip chromium_src-345e1b89c38bf19ebce483ae5392474bbf63ae59.tar.gz chromium_src-345e1b89c38bf19ebce483ae5392474bbf63ae59.tar.bz2 |
Unbreak unit tests. Revert r7564.
tbr=jhawkins
Review URL: http://codereview.chromium.org/16522
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7571 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/download_item_view.cc | 10 | ||||
-rw-r--r-- | chrome/browser/views/download_tab_view.cc | 14 |
2 files changed, 11 insertions, 13 deletions
diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc index 6579e55..f3e4a2a 100644 --- a/chrome/browser/views/download_item_view.cc +++ b/chrome/browser/views/download_item_view.cc @@ -201,7 +201,7 @@ DownloadItemView::DownloadItemView(DownloadItem* download, discard_button_->set_enforce_dlu_min_size(false); AddChildView(save_button_); AddChildView(discard_button_); - std::wstring file_name = download->original_name().ToWStringHack(); + std::wstring file_name = download->original_name(); // Ensure the file name is not too long. @@ -457,7 +457,7 @@ void DownloadItemView::Paint(ChromeCanvas* canvas) { // Note that in dangerous mode we use a label (as the text is multi-line). if (!IsDangerousMode()) { std::wstring filename = - gfx::ElideFilename(download_->GetFileName().ToWStringHack(), + gfx::ElideFilename(download_->GetFileName(), font_, kTextWidth); @@ -487,7 +487,7 @@ void DownloadItemView::Paint(ChromeCanvas* canvas) { // Paint the icon. IconManager* im = g_browser_process->icon_manager(); SkBitmap* icon = IsDangerousMode() ? warning_icon_ : - im->LookupIcon(download_->full_path().ToWStringHack(), IconLoader::SMALL); + im->LookupIcon(download_->full_path(), 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 @@ -716,7 +716,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_->full_path().ToWStringHack(), + SkBitmap* icon = im->LookupIcon(download_->full_path(), IconLoader::SMALL); if (icon) download_util::DragDownload(download_, icon); @@ -750,7 +750,7 @@ void DownloadItemView::OnExtractIconComplete(IconManager::Handle handle, void DownloadItemView::LoadIcon() { IconManager* im = g_browser_process->icon_manager(); - im->LoadIcon(download_->full_path().ToWStringHack(), IconLoader::SMALL, + im->LoadIcon(download_->full_path(), IconLoader::SMALL, &icon_consumer_, NewCallback(this, &DownloadItemView::OnExtractIconComplete)); } diff --git a/chrome/browser/views/download_tab_view.cc b/chrome/browser/views/download_tab_view.cc index 474f0a7..b0d7c77 100644 --- a/chrome/browser/views/download_tab_view.cc +++ b/chrome/browser/views/download_tab_view.cc @@ -285,8 +285,7 @@ void DownloadItemTabView::LayoutComplete() { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); ChromeFont font = rb.GetFont(ResourceBundle::WebFont); file_name_->SetText( - gfx::ElideFilename(model_->GetFileName().ToWStringHack(), font, - kFilenameSize)); + gfx::ElideFilename(model_->GetFileName(), font, kFilenameSize)); gfx::Size file_name_size = file_name_->GetPreferredSize(); @@ -340,7 +339,7 @@ void DownloadItemTabView::LayoutCancelled() { // File name and URL, truncated to show cancelled status ResourceBundle& rb = ResourceBundle::GetSharedInstance(); ChromeFont font = rb.GetFont(ResourceBundle::WebFont); - file_name_->SetText(gfx::ElideFilename(model_->GetFileName().ToWStringHack(), + file_name_->SetText(gfx::ElideFilename(model_->GetFileName(), font, kFilenameSize)); gfx::Size file_name_size = file_name_->GetPreferredSize(); @@ -431,7 +430,7 @@ void DownloadItemTabView::LayoutInProgress() { // File name and URL, truncated to show progress status ResourceBundle& rb = ResourceBundle::GetSharedInstance(); ChromeFont font = rb.GetFont(ResourceBundle::WebFont); - file_name_->SetText(gfx::ElideFilename(model_->GetFileName().ToWStringHack(), + file_name_->SetText(gfx::ElideFilename(model_->GetFileName(), font, kFilenameSize)); gfx::Size file_name_size = file_name_->GetPreferredSize(); @@ -591,7 +590,7 @@ void DownloadItemTabView::LayoutPromptDangerousDownload() { // Warning message and URL. std::wstring file_name; - ElideString(model_->original_name().ToWStringHack(), kFileNameMaxLength, &file_name); + ElideString(model_->original_name(), kFileNameMaxLength, &file_name); dangerous_download_warning_->SetText( l10n_util::GetStringF(IDS_PROMPT_DANGEROUS_DOWNLOAD, file_name)); gfx::Size warning_size = dangerous_download_warning_->GetPreferredSize(); @@ -1075,8 +1074,7 @@ void DownloadTabView::SetDownloads(std::vector<DownloadItem*>& downloads) { SkBitmap* DownloadTabView::LookupIcon(DownloadItem* download) { IconManager* im = g_browser_process->icon_manager(); // Fast look up. - SkBitmap* icon = im->LookupIcon(download->full_path().ToWStringHack(), - IconLoader::NORMAL); + SkBitmap* icon = im->LookupIcon(download->full_path(), IconLoader::NORMAL); // Expensive look up. if (!icon) @@ -1091,7 +1089,7 @@ SkBitmap* DownloadTabView::LookupIcon(DownloadItem* download) { void DownloadTabView::LoadIcon(DownloadItem* download) { IconManager* im = g_browser_process->icon_manager(); IconManager::Handle h = - im->LoadIcon(download->full_path().ToWStringHack(), IconLoader::NORMAL, + im->LoadIcon(download->full_path(), IconLoader::NORMAL, &icon_consumer_, NewCallback(this, &DownloadTabView::OnExtractIconComplete)); icon_consumer_.SetClientData(im, h, download); |