diff options
author | Iain Merrick <husky@google.com> | 2010-11-01 12:19:54 +0000 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-11-03 10:21:10 +0000 |
commit | 731df977c0511bca2206b5f333555b1205ff1f43 (patch) | |
tree | 0e750b949b3f00a1ac11fda25d3c2de512f2b465 /chrome/browser/content_exceptions_table_model.cc | |
parent | 5add15e10e7bb80512f2c597ca57221314abe577 (diff) | |
download | external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.zip external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.gz external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.bz2 |
Merge Chromium at r63472 : Initial merge by git.
Change-Id: Ifb9ee821af006a5f2211e81471be93ae440a1f5a
Diffstat (limited to 'chrome/browser/content_exceptions_table_model.cc')
-rw-r--r-- | chrome/browser/content_exceptions_table_model.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/content_exceptions_table_model.cc b/chrome/browser/content_exceptions_table_model.cc index bf32612..84e8c2d 100644 --- a/chrome/browser/content_exceptions_table_model.cc +++ b/chrome/browser/content_exceptions_table_model.cc @@ -27,8 +27,10 @@ ContentExceptionsTableModel::ContentExceptionsTableModel( } } +ContentExceptionsTableModel::~ContentExceptionsTableModel() {} + void ContentExceptionsTableModel::AddException( - const HostContentSettingsMap::Pattern& pattern, + const HostContentSettingsMap::Pattern& original_pattern, ContentSetting setting, bool is_off_the_record) { DCHECK(!is_off_the_record || off_the_record_map_); @@ -36,6 +38,9 @@ void ContentExceptionsTableModel::AddException( int insert_position = is_off_the_record ? RowCount() : static_cast<int>(entries_.size()); + const HostContentSettingsMap::Pattern pattern( + original_pattern.CanonicalizePattern()); + entries(is_off_the_record).push_back( HostContentSettingsMap::PatternSettingPair(pattern, setting)); map(is_off_the_record)->SetContentSetting(pattern, @@ -72,13 +77,16 @@ void ContentExceptionsTableModel::RemoveAll() { } int ContentExceptionsTableModel::IndexOfExceptionByPattern( - const HostContentSettingsMap::Pattern& pattern, + const HostContentSettingsMap::Pattern& original_pattern, bool is_off_the_record) { DCHECK(!is_off_the_record || off_the_record_map_); int offset = is_off_the_record ? static_cast<int>(entries_.size()) : 0; + const HostContentSettingsMap::Pattern pattern( + original_pattern.CanonicalizePattern()); + // This is called on every key type in the editor. Move to a map if we end up // with lots of exceptions. for (size_t i = 0; i < entries(is_off_the_record).size(); ++i) { @@ -105,6 +113,8 @@ std::wstring ContentExceptionsTableModel::GetText(int row, int column_id) { return l10n_util::GetString(IDS_EXCEPTIONS_ALLOW_BUTTON); case CONTENT_SETTING_BLOCK: return l10n_util::GetString(IDS_EXCEPTIONS_BLOCK_BUTTON); + case CONTENT_SETTING_ASK: + return l10n_util::GetString(IDS_EXCEPTIONS_ASK_BUTTON); case CONTENT_SETTING_SESSION_ONLY: return l10n_util::GetString(IDS_EXCEPTIONS_SESSION_ONLY_BUTTON); default: |