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/notifications/notification_exceptions_table_model.h" | 5 #include "chrome/browser/notifications/notification_exceptions_table_model.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/table_model_observer.h" | 8 #include "app/table_model_observer.h" |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 // TODO(avi): remove when conversions not needed any more |
10 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
11 #include "chrome/common/content_settings.h" | 12 #include "chrome/common/content_settings.h" |
12 #include "chrome/common/content_settings_helper.h" | 13 #include "chrome/common/content_settings_helper.h" |
13 #include "chrome/common/content_settings_types.h" | 14 #include "chrome/common/content_settings_types.h" |
14 #include "chrome/common/notification_service.h" | 15 #include "chrome/common/notification_service.h" |
15 #include "chrome/common/notification_type.h" | 16 #include "chrome/common/notification_type.h" |
16 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
18 | 19 |
19 struct NotificationExceptionsTableModel::Entry { | 20 struct NotificationExceptionsTableModel::Entry { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 std::wstring NotificationExceptionsTableModel::GetText(int row, | 75 std::wstring NotificationExceptionsTableModel::GetText(int row, |
75 int column_id) { | 76 int column_id) { |
76 const Entry& entry = entries_[row]; | 77 const Entry& entry = entries_[row]; |
77 if (column_id == IDS_EXCEPTIONS_HOSTNAME_HEADER) { | 78 if (column_id == IDS_EXCEPTIONS_HOSTNAME_HEADER) { |
78 return content_settings_helper::OriginToWString(entry.origin); | 79 return content_settings_helper::OriginToWString(entry.origin); |
79 } | 80 } |
80 | 81 |
81 if (column_id == IDS_EXCEPTIONS_ACTION_HEADER) { | 82 if (column_id == IDS_EXCEPTIONS_ACTION_HEADER) { |
82 switch (entry.setting) { | 83 switch (entry.setting) { |
83 case CONTENT_SETTING_ALLOW: | 84 case CONTENT_SETTING_ALLOW: |
84 return l10n_util::GetString(IDS_EXCEPTIONS_ALLOW_BUTTON); | 85 return UTF16ToWideHack( |
| 86 l10n_util::GetStringUTF16(IDS_EXCEPTIONS_ALLOW_BUTTON)); |
85 case CONTENT_SETTING_BLOCK: | 87 case CONTENT_SETTING_BLOCK: |
86 return l10n_util::GetString(IDS_EXCEPTIONS_BLOCK_BUTTON); | 88 return UTF16ToWideHack( |
| 89 l10n_util::GetStringUTF16(IDS_EXCEPTIONS_BLOCK_BUTTON)); |
87 default: | 90 default: |
88 break; | 91 break; |
89 } | 92 } |
90 } | 93 } |
91 | 94 |
92 NOTREACHED(); | 95 NOTREACHED(); |
93 return std::wstring(); | 96 return std::wstring(); |
94 } | 97 } |
95 | 98 |
96 void NotificationExceptionsTableModel::SetObserver( | 99 void NotificationExceptionsTableModel::SetObserver( |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 ContentSetting in_setting) | 131 ContentSetting in_setting) |
129 : origin(in_origin), | 132 : origin(in_origin), |
130 setting(in_setting) { | 133 setting(in_setting) { |
131 } | 134 } |
132 | 135 |
133 bool NotificationExceptionsTableModel::Entry::operator<( | 136 bool NotificationExceptionsTableModel::Entry::operator<( |
134 const NotificationExceptionsTableModel::Entry& b) const { | 137 const NotificationExceptionsTableModel::Entry& b) const { |
135 DCHECK_NE(origin, b.origin); | 138 DCHECK_NE(origin, b.origin); |
136 return origin < b.origin; | 139 return origin < b.origin; |
137 } | 140 } |
OLD | NEW |