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

Unified Diff: chrome/browser/notifications/notification_ui_manager_impl.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month 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/notifications/notification_ui_manager_impl.h ('k') | chrome/browser/plugins/plugin_prefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/notification_ui_manager_impl.cc
diff --git a/chrome/browser/notifications/notification_ui_manager_impl.cc b/chrome/browser/notifications/notification_ui_manager_impl.cc
index f02b0f5d894da6e8279157224057bf4a6f600972..bf096c3d0190d63c9cb535dca0adaf52af5c9d52 100644
--- a/chrome/browser/notifications/notification_ui_manager_impl.cc
+++ b/chrome/browser/notifications/notification_ui_manager_impl.cc
@@ -233,13 +233,17 @@ void NotificationUIManagerImpl::Observe(
const content::NotificationDetails& details) {
if (type == chrome::NOTIFICATION_APP_TERMINATING) {
CancelAll();
- } else if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- std::string* name = content::Details<std::string>(details).ptr();
- if (*name == prefs::kDesktopNotificationPosition)
- balloon_collection_->SetPositionPreference(
- static_cast<BalloonCollection::PositionPreference>(
- position_pref_.GetValue()));
} else {
NOTREACHED();
}
}
+
+void NotificationUIManagerImpl::OnPreferenceChanged(
+ PrefServiceBase* service,
+ const std::string& pref_name) {
+ if (pref_name == prefs::kDesktopNotificationPosition) {
+ balloon_collection_->SetPositionPreference(
+ static_cast<BalloonCollection::PositionPreference>(
+ position_pref_.GetValue()));
+ }
+}
« no previous file with comments | « chrome/browser/notifications/notification_ui_manager_impl.h ('k') | chrome/browser/plugins/plugin_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698