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

Unified Diff: chrome/browser/net/http_server_properties_manager.cc

Issue 11414083: Remove PrefObserver usage, batch 9. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to sort-of good revision (r169014). 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/net/http_server_properties_manager.h ('k') | chrome/browser/net/net_pref_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/http_server_properties_manager.cc
diff --git a/chrome/browser/net/http_server_properties_manager.cc b/chrome/browser/net/http_server_properties_manager.cc
index 461a1d9e4a03ff183b20b5e513654b8f22051e47..167392de46737e0fbe0c7a41e5351226c3b6885d 100644
--- a/chrome/browser/net/http_server_properties_manager.cc
+++ b/chrome/browser/net/http_server_properties_manager.cc
@@ -57,7 +57,10 @@ HttpServerPropertiesManager::HttpServerPropertiesManager(
ui_cache_update_timer_.reset(
new base::OneShotTimer<HttpServerPropertiesManager>);
pref_change_registrar_.Init(pref_service_);
- pref_change_registrar_.Add(prefs::kHttpServerProperties, this);
+ pref_change_registrar_.Add(
+ prefs::kHttpServerProperties,
+ base::Bind(&HttpServerPropertiesManager::OnHttpServerPropertiesChanged,
+ base::Unretained(this)));
}
HttpServerPropertiesManager::~HttpServerPropertiesManager() {
@@ -656,17 +659,10 @@ void HttpServerPropertiesManager::UpdatePrefsOnUI(
completion.Run();
}
-void HttpServerPropertiesManager::OnPreferenceChanged(
- PrefServiceBase* prefs,
- const std::string& pref_name) {
+void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(prefs == pref_service_);
- if (pref_name == prefs::kHttpServerProperties) {
- if (!setting_prefs_)
- ScheduleUpdateCacheOnUI();
- } else {
- NOTREACHED();
- }
+ if (!setting_prefs_)
+ ScheduleUpdateCacheOnUI();
}
} // namespace chrome_browser_net
« no previous file with comments | « chrome/browser/net/http_server_properties_manager.h ('k') | chrome/browser/net/net_pref_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698