OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/download/download_item_view.h" | 5 #include "chrome/browser/ui/views/download/download_item_view.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 #endif | 284 #endif |
285 | 285 |
286 // Elide giant extensions (this shouldn't currently be hit, but might | 286 // Elide giant extensions (this shouldn't currently be hit, but might |
287 // in future, should we ever notice unsafe giant extensions). | 287 // in future, should we ever notice unsafe giant extensions). |
288 if (extension.length() > kFileNameMaxLength / 2) | 288 if (extension.length() > kFileNameMaxLength / 2) |
289 ui::ElideString(extension, kFileNameMaxLength / 2, &extension); | 289 ui::ElideString(extension, kFileNameMaxLength / 2, &extension); |
290 | 290 |
291 // The dangerous download label text and icon are different | 291 // The dangerous download label text and icon are different |
292 // under different cases. | 292 // under different cases. |
293 string16 dangerous_label; | 293 string16 dangerous_label; |
294 if (download->danger_type() == DownloadItem::DANGEROUS_URL) { | 294 if (download->GetDangerType() == DownloadItem::DANGEROUS_URL) { |
295 // Safebrowsing shows the download URL leads to malicious file. | 295 // Safebrowsing shows the download URL leads to malicious file. |
296 warning_icon_ = rb.GetBitmapNamed(IDR_SAFEBROWSING_WARNING); | 296 warning_icon_ = rb.GetBitmapNamed(IDR_SAFEBROWSING_WARNING); |
297 dangerous_label = | 297 dangerous_label = |
298 l10n_util::GetStringUTF16(IDS_PROMPT_UNSAFE_DOWNLOAD_URL); | 298 l10n_util::GetStringUTF16(IDS_PROMPT_UNSAFE_DOWNLOAD_URL); |
299 } else { | 299 } else { |
300 // The download file has dangerous file type (e.g.: an executable). | 300 // The download file has dangerous file type (e.g.: an executable). |
301 DCHECK(download->danger_type() == DownloadItem::DANGEROUS_FILE); | 301 DCHECK(download->GetDangerType() == DownloadItem::DANGEROUS_FILE); |
302 warning_icon_ = rb.GetBitmapNamed(IDR_WARNING); | 302 warning_icon_ = rb.GetBitmapNamed(IDR_WARNING); |
303 if (download->is_extension_install()) { | 303 if (download->is_extension_install()) { |
304 dangerous_label = | 304 dangerous_label = |
305 l10n_util::GetStringUTF16(IDS_PROMPT_DANGEROUS_DOWNLOAD_EXTENSION); | 305 l10n_util::GetStringUTF16(IDS_PROMPT_DANGEROUS_DOWNLOAD_EXTENSION); |
306 } else { | 306 } else { |
307 ui::ElideString(rootname, | 307 ui::ElideString(rootname, |
308 kFileNameMaxLength - extension.length(), | 308 kFileNameMaxLength - extension.length(), |
309 &rootname); | 309 &rootname); |
310 string16 filename = rootname + ASCIIToUTF16(".") + extension; | 310 string16 filename = rootname + ASCIIToUTF16(".") + extension; |
311 filename = base::i18n::GetDisplayStringInLTRDirectionality(filename); | 311 filename = base::i18n::GetDisplayStringInLTRDirectionality(filename); |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 // If the name has changed, notify assistive technology that the name | 1147 // If the name has changed, notify assistive technology that the name |
1148 // has changed so they can announce it immediately. | 1148 // has changed so they can announce it immediately. |
1149 if (new_name != accessible_name_) { | 1149 if (new_name != accessible_name_) { |
1150 accessible_name_ = new_name; | 1150 accessible_name_ = new_name; |
1151 if (GetWidget()) { | 1151 if (GetWidget()) { |
1152 GetWidget()->NotifyAccessibilityEvent( | 1152 GetWidget()->NotifyAccessibilityEvent( |
1153 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true); | 1153 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true); |
1154 } | 1154 } |
1155 } | 1155 } |
1156 } | 1156 } |
OLD | NEW |