Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: chrome/browser/ui/gtk/options/content_exception_editor.cc

Issue 6627038: gtk: Rename OnDialogResponse() to OnResponse() to standardize on a consistent naming scheme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/gtk/options/content_exception_editor.h" 5 #include "chrome/browser/ui/gtk/options/content_exception_editor.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/content_exceptions_table_model.h" 9 #include "chrome/browser/content_exceptions_table_model.h"
10 #include "chrome/browser/content_settings/host_content_settings_map.h" 10 #include "chrome/browser/content_settings/host_content_settings_map.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 void ContentExceptionEditor::OnEntryChanged(GtkWidget* entry) { 109 void ContentExceptionEditor::OnEntryChanged(GtkWidget* entry) {
110 ContentSettingsPattern new_pattern(gtk_entry_get_text(GTK_ENTRY(entry))); 110 ContentSettingsPattern new_pattern(gtk_entry_get_text(GTK_ENTRY(entry)));
111 bool is_off_the_record = 111 bool is_off_the_record =
112 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(otr_checkbox_)); 112 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(otr_checkbox_));
113 bool is_valid = IsPatternValid(new_pattern, is_off_the_record); 113 bool is_valid = IsPatternValid(new_pattern, is_off_the_record);
114 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog_), 114 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog_),
115 GTK_RESPONSE_OK, is_valid); 115 GTK_RESPONSE_OK, is_valid);
116 UpdateImage(pattern_image_, is_valid); 116 UpdateImage(pattern_image_, is_valid);
117 } 117 }
118 118
119 void ContentExceptionEditor::OnResponse(GtkWidget* sender, int response_id) { 119 void ContentExceptionEditor::OnResponse(GtkWidget* dialog, int response_id) {
120 if (response_id == GTK_RESPONSE_OK) { 120 if (response_id == GTK_RESPONSE_OK) {
121 // Notify our delegate to update everything. 121 // Notify our delegate to update everything.
122 ContentSettingsPattern new_pattern(gtk_entry_get_text(GTK_ENTRY(entry_))); 122 ContentSettingsPattern new_pattern(gtk_entry_get_text(GTK_ENTRY(entry_)));
123 ContentSetting setting = cb_model_.SettingForIndex( 123 ContentSetting setting = cb_model_.SettingForIndex(
124 gtk_combo_box_get_active(GTK_COMBO_BOX(action_combo_))); 124 gtk_combo_box_get_active(GTK_COMBO_BOX(action_combo_)));
125 bool is_off_the_record = 125 bool is_off_the_record =
126 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(otr_checkbox_)); 126 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(otr_checkbox_));
127 delegate_->AcceptExceptionEdit( 127 delegate_->AcceptExceptionEdit(
128 new_pattern, setting, is_off_the_record, index_, is_new()); 128 new_pattern, setting, is_off_the_record, index_, is_new());
129 } 129 }
130 130
131 gtk_widget_destroy(dialog_); 131 gtk_widget_destroy(dialog_);
132 } 132 }
133 133
134 void ContentExceptionEditor::OnWindowDestroy(GtkWidget* widget) { 134 void ContentExceptionEditor::OnWindowDestroy(GtkWidget* widget) {
135 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 135 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
136 } 136 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698