| 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/content_exceptions_table_model.h" | 5 #include "chrome/browser/content_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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 std::wstring ContentExceptionsTableModel::GetText(int row, int column_id) { | 103 std::wstring ContentExceptionsTableModel::GetText(int row, int column_id) { |
| 104 HostContentSettingsMap::PatternSettingPair entry = entry_at(row); | 104 HostContentSettingsMap::PatternSettingPair entry = entry_at(row); |
| 105 | 105 |
| 106 switch (column_id) { | 106 switch (column_id) { |
| 107 case IDS_EXCEPTIONS_PATTERN_HEADER: | 107 case IDS_EXCEPTIONS_PATTERN_HEADER: |
| 108 return UTF8ToWide(entry.first.AsString()); | 108 return UTF8ToWide(entry.first.AsString()); |
| 109 | 109 |
| 110 case IDS_EXCEPTIONS_ACTION_HEADER: | 110 case IDS_EXCEPTIONS_ACTION_HEADER: |
| 111 switch (entry.second) { | 111 switch (entry.second) { |
| 112 case CONTENT_SETTING_ALLOW: | 112 case CONTENT_SETTING_ALLOW: |
| 113 return l10n_util::GetString(IDS_EXCEPTIONS_ALLOW_BUTTON); | 113 return UTF16ToWideHack( |
| 114 l10n_util::GetStringUTF16(IDS_EXCEPTIONS_ALLOW_BUTTON)); |
| 114 case CONTENT_SETTING_BLOCK: | 115 case CONTENT_SETTING_BLOCK: |
| 115 return l10n_util::GetString(IDS_EXCEPTIONS_BLOCK_BUTTON); | 116 return UTF16ToWideHack( |
| 117 l10n_util::GetStringUTF16(IDS_EXCEPTIONS_BLOCK_BUTTON)); |
| 116 case CONTENT_SETTING_ASK: | 118 case CONTENT_SETTING_ASK: |
| 117 return l10n_util::GetString(IDS_EXCEPTIONS_ASK_BUTTON); | 119 return UTF16ToWideHack( |
| 120 l10n_util::GetStringUTF16(IDS_EXCEPTIONS_ASK_BUTTON)); |
| 118 case CONTENT_SETTING_SESSION_ONLY: | 121 case CONTENT_SETTING_SESSION_ONLY: |
| 119 return l10n_util::GetString(IDS_EXCEPTIONS_SESSION_ONLY_BUTTON); | 122 return UTF16ToWideHack( |
| 123 l10n_util::GetStringUTF16(IDS_EXCEPTIONS_SESSION_ONLY_BUTTON)); |
| 120 default: | 124 default: |
| 121 NOTREACHED(); | 125 NOTREACHED(); |
| 122 } | 126 } |
| 123 break; | 127 break; |
| 124 | 128 |
| 125 default: | 129 default: |
| 126 NOTREACHED(); | 130 NOTREACHED(); |
| 127 } | 131 } |
| 128 | 132 |
| 129 return std::wstring(); | 133 return std::wstring(); |
| 130 } | 134 } |
| 131 | 135 |
| 132 void ContentExceptionsTableModel::SetObserver(TableModelObserver* observer) { | 136 void ContentExceptionsTableModel::SetObserver(TableModelObserver* observer) { |
| 133 observer_ = observer; | 137 observer_ = observer; |
| 134 } | 138 } |
| OLD | NEW |