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

Unified Diff: chrome/browser/content_exceptions_table_model.cc

Issue 3017011: Make content settings map updates live.
Patch Set: Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/content_exceptions_table_model.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/content_exceptions_table_model.cc
diff --git a/chrome/browser/content_exceptions_table_model.cc b/chrome/browser/content_exceptions_table_model.cc
index 4d4eda97b874d3a39b187a19a1f7f1e2d1b6be8c..6103e72cc4bad18f5fb50721a45d2743c60de6d6 100644
--- a/chrome/browser/content_exceptions_table_model.cc
+++ b/chrome/browser/content_exceptions_table_model.cc
@@ -16,6 +16,9 @@ ContentExceptionsTableModel::ContentExceptionsTableModel(
: map_(map),
content_type_(type),
observer_(NULL) {
+ registrar_.Add(this, NotificationType::CONTENT_SETTINGS_CHANGED,
+ NotificationService::AllSources());
+
// Load the contents.
map->GetSettingsForOneType(type, &entries_);
}
@@ -89,3 +92,18 @@ std::wstring ContentExceptionsTableModel::GetText(int row, int column_id) {
void ContentExceptionsTableModel::SetObserver(TableModelObserver* observer) {
observer_ = observer;
}
+
+void ContentExceptionsTableModel::Observe(
+ NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ // XXX: check the notification is for the right type
+fprintf(stderr, "observing\n");
+ // Reload the contents.
+ map_->GetSettingsForOneType(content_type_, &entries_);
+
+ if (observer_) {
+fprintf(stderr, "notifying\n");
+ observer_->OnModelChanged();
+ }
+}
« no previous file with comments | « chrome/browser/content_exceptions_table_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698