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

Unified Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 23851016: Convert zoom callbacks to use CallbackRegistry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge Created 7 years, 3 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
Index: chrome/browser/profiles/off_the_record_profile_impl.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc
index ad8c5297c972e163fda5e573a3de897c1684e7d1..cfa8445d6ee09045a4b7cc20d104e57db54637d8 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -90,9 +90,7 @@ OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile)
: profile_(real_profile),
prefs_(PrefServiceSyncable::IncognitoFromProfile(real_profile)),
io_data_(this),
- start_time_(Time::Now()),
- zoom_callback_(base::Bind(&OffTheRecordProfileImpl::OnZoomLevelChanged,
- base::Unretained(this))) {
+ start_time_(Time::Now()) {
// Register on BrowserContext.
user_prefs::UserPrefs::Set(this, prefs_);
}
@@ -137,9 +135,6 @@ void OffTheRecordProfileImpl::Init() {
OffTheRecordProfileImpl::~OffTheRecordProfileImpl() {
MaybeSendDestroyedNotification();
- HostZoomMap::GetForBrowserContext(profile_)->RemoveZoomLevelChangedCallback(
- zoom_callback_);
-
#if defined(ENABLE_PLUGINS)
ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext(
io_data_.GetResourceContextNoInit());
@@ -170,7 +165,9 @@ void OffTheRecordProfileImpl::InitHostZoomMap() {
host_zoom_map->CopyFrom(parent_host_zoom_map);
// Observe parent's HZM change for propagating change of parent's
// change to this HZM.
- parent_host_zoom_map->AddZoomLevelChangedCallback(zoom_callback_);
+ zoom_subscription_ = parent_host_zoom_map->AddZoomLevelChangedCallback(
+ base::Bind(&OffTheRecordProfileImpl::OnZoomLevelChanged,
+ base::Unretained(this)));
}
#if defined(OS_ANDROID) || defined(OS_IOS)
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl.h ('k') | chrome/browser/profiles/off_the_record_profile_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698