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_item_view.h" | 5 #include "chrome/browser/ui/views/download_item_view.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 SetEnabled(true); // Triggers a repaint. | 1054 SetEnabled(true); // Triggers a repaint. |
1055 } | 1055 } |
1056 | 1056 |
1057 bool DownloadItemView::InDropDownButtonXCoordinateRange(int x) { | 1057 bool DownloadItemView::InDropDownButtonXCoordinateRange(int x) { |
1058 if (x > drop_down_x_left_ && x < drop_down_x_right_) | 1058 if (x > drop_down_x_left_ && x < drop_down_x_right_) |
1059 return true; | 1059 return true; |
1060 return false; | 1060 return false; |
1061 } | 1061 } |
1062 | 1062 |
1063 void DownloadItemView::UpdateAccessibleName() { | 1063 void DownloadItemView::UpdateAccessibleName() { |
1064 std::wstring current_name; | 1064 string16 current_name; |
1065 GetAccessibleName(¤t_name); | 1065 GetAccessibleName(¤t_name); |
1066 | 1066 |
1067 std::wstring new_name; | 1067 string16 new_name; |
1068 if (download_->safety_state() == DownloadItem::DANGEROUS) { | 1068 if (download_->safety_state() == DownloadItem::DANGEROUS) { |
1069 new_name = dangerous_download_label_->GetText(); | 1069 new_name = WideToUTF16Hack(dangerous_download_label_->GetText()); |
1070 } else { | 1070 } else { |
1071 new_name = status_text_ + L" " + | 1071 new_name = WideToUTF16Hack(status_text_) + char16(' ') + |
1072 download_->GetFileNameToReportUser().ToWStringHack(); | 1072 WideToUTF16Hack(download_->GetFileNameToReportUser().ToWStringHack()); |
1073 } | 1073 } |
1074 | 1074 |
1075 // If the name has changed, call SetAccessibleName and notify | 1075 // If the name has changed, call SetAccessibleName and notify |
1076 // assistive technology that the name has changed so they can | 1076 // assistive technology that the name has changed so they can |
1077 // announce it immediately. | 1077 // announce it immediately. |
1078 if (new_name != current_name) { | 1078 if (new_name != current_name) { |
1079 SetAccessibleName(new_name); | 1079 SetAccessibleName(new_name); |
1080 if (GetWidget()) | 1080 if (GetWidget()) |
1081 NotifyAccessibilityEvent(AccessibilityTypes::EVENT_NAME_CHANGED); | 1081 NotifyAccessibilityEvent(AccessibilityTypes::EVENT_NAME_CHANGED); |
1082 } | 1082 } |
1083 } | 1083 } |
OLD | NEW |