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

Unified Diff: chrome/browser/ui/prefs/prefs_tab_helper.cc

Issue 22859034: WIP CallbackList in action (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/ui/prefs/prefs_tab_helper.h ('k') | chrome/browser/user_style_sheet_watcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/prefs/prefs_tab_helper.cc
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
index 05918767ed30da816097206dcc236ec61cf1ed04..b637ab098376e65ae21ac2b25d31157723de018b 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -465,7 +465,7 @@ PrefsTabHelper::PrefsTabHelper(WebContents* contents)
UserStyleSheetWatcher* uss =
UserStyleSheetWatcherFactory::GetForProfile(GetProfile());
if (uss) {
- uss->RegisterOnStyleSheetUpdatedCallback(
+ remove_callback_ = uss->RegisterOnStyleSheetUpdatedCallback(
base::Bind(&PrefsTabHelper::UpdateWebPreferences,
weak_ptr_factory_.GetWeakPtr()));
}
@@ -483,6 +483,7 @@ PrefsTabHelper::PrefsTabHelper(WebContents* contents)
}
PrefsTabHelper::~PrefsTabHelper() {
+ remove_callback_.Run();
}
// static
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.h ('k') | chrome/browser/user_style_sheet_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698