| Index: chrome/browser/gtk/options/content_exception_editor.cc
|
| diff --git a/chrome/browser/gtk/options/content_exception_editor.cc b/chrome/browser/gtk/options/content_exception_editor.cc
|
| index ea12db91b86040c0c658d22ca02090eee06be487..002dfb32bdf447d7c7f774673e495677457b13fb 100644
|
| --- a/chrome/browser/gtk/options/content_exception_editor.cc
|
| +++ b/chrome/browser/gtk/options/content_exception_editor.cc
|
| @@ -18,9 +18,11 @@ ContentExceptionEditor::ContentExceptionEditor(
|
| GtkWindow* parent,
|
| ContentExceptionEditor::Delegate* delegate,
|
| ContentExceptionsTableModel* model,
|
| + bool allow_off_the_record,
|
| int index,
|
| const HostContentSettingsMap::Pattern& pattern,
|
| - ContentSetting setting)
|
| + ContentSetting setting,
|
| + bool is_off_the_record)
|
| : delegate_(delegate),
|
| model_(model),
|
| cb_model_(model->content_type() == CONTENT_SETTINGS_TYPE_COOKIES),
|
| @@ -56,6 +58,11 @@ ContentExceptionEditor::ContentExceptionEditor(
|
| gtk_combo_box_set_active(GTK_COMBO_BOX(action_combo_),
|
| cb_model_.IndexForSetting(setting_));
|
|
|
| + otr_checkbox_ = gtk_check_button_new_with_label(
|
| + l10n_util::GetStringUTF8(IDS_EXCEPTION_EDITOR_OTR_TITLE).c_str());
|
| + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(otr_checkbox_),
|
| + is_off_the_record);
|
| +
|
| GtkWidget* table = gtk_util::CreateLabeledControlsGroup(
|
| NULL,
|
| l10n_util::GetStringUTF8(IDS_EXCEPTION_EDITOR_PATTERN_TITLE).c_str(),
|
| @@ -63,6 +70,10 @@ ContentExceptionEditor::ContentExceptionEditor(
|
| l10n_util::GetStringUTF8(IDS_EXCEPTION_EDITOR_ACTION_TITLE).c_str(),
|
| action_combo_,
|
| NULL);
|
| + if (allow_off_the_record) {
|
| + gtk_table_attach(GTK_TABLE(table), otr_checkbox_,
|
| + 0, 2, 2, 3, GTK_FILL, GTK_FILL, 0, 0);
|
| + }
|
| gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), table,
|
| FALSE, FALSE, 0);
|
|
|
| @@ -79,9 +90,10 @@ ContentExceptionEditor::ContentExceptionEditor(
|
| }
|
|
|
| bool ContentExceptionEditor::IsPatternValid(
|
| - const HostContentSettingsMap::Pattern& pattern) const {
|
| + const HostContentSettingsMap::Pattern& pattern,
|
| + bool is_off_the_record) const {
|
| bool is_valid_pattern = pattern.IsValid() &&
|
| - (model_->IndexOfExceptionByPattern(pattern) == -1);
|
| + (model_->IndexOfExceptionByPattern(pattern, is_off_the_record) == -1);
|
|
|
| return is_new() ? is_valid_pattern : (!pattern.AsString().empty() &&
|
| ((pattern_ == pattern) || is_valid_pattern));
|
| @@ -96,7 +108,9 @@ void ContentExceptionEditor::UpdateImage(GtkWidget* image, bool is_valid) {
|
| void ContentExceptionEditor::OnEntryChanged(GtkWidget* entry) {
|
| HostContentSettingsMap::Pattern new_pattern(
|
| gtk_entry_get_text(GTK_ENTRY(entry)));
|
| - bool is_valid = IsPatternValid(new_pattern);
|
| + bool is_off_the_record =
|
| + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(otr_checkbox_));
|
| + bool is_valid = IsPatternValid(new_pattern, is_off_the_record);
|
| gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog_),
|
| GTK_RESPONSE_OK, is_valid);
|
| UpdateImage(pattern_image_, is_valid);
|
| @@ -109,7 +123,10 @@ void ContentExceptionEditor::OnResponse(GtkWidget* sender, int response_id) {
|
| gtk_entry_get_text(GTK_ENTRY(entry_)));
|
| ContentSetting setting = cb_model_.SettingForIndex(
|
| gtk_combo_box_get_active(GTK_COMBO_BOX(action_combo_)));
|
| - delegate_->AcceptExceptionEdit(new_pattern, setting, index_, is_new());
|
| + bool is_off_the_record =
|
| + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(otr_checkbox_));
|
| + delegate_->AcceptExceptionEdit(
|
| + new_pattern, setting, is_off_the_record, index_, is_new());
|
| }
|
|
|
| gtk_widget_destroy(dialog_);
|
|
|