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

Side by Side Diff: base/prefs/public/pref_change_registrar.cc

Issue 11243002: Move the bits of Prefs where production code has only trivially easy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments, fix gypi problem Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/api/prefs/pref_change_registrar.h" 5 #include "base/prefs/public/pref_change_registrar.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/api/prefs/pref_service_base.h" 8 #include "base/prefs/public/pref_service_base.h"
9 9
10 PrefChangeRegistrar::PrefChangeRegistrar() : service_(NULL) {} 10 PrefChangeRegistrar::PrefChangeRegistrar() : service_(NULL) {}
11 11
12 PrefChangeRegistrar::~PrefChangeRegistrar() { 12 PrefChangeRegistrar::~PrefChangeRegistrar() {
13 // If you see an invalid memory access in this destructor, this 13 // If you see an invalid memory access in this destructor, this
14 // PrefChangeRegistrar might be subscribed to an OffTheRecordProfileImpl that 14 // PrefChangeRegistrar might be subscribed to an OffTheRecordProfileImpl that
15 // has been destroyed. This should not happen any more but be warned. 15 // has been destroyed. This should not happen any more but be warned.
16 // Feel free to contact battre@chromium.org in case this happens. 16 // Feel free to contact battre@chromium.org in case this happens.
17 RemoveAll(); 17 RemoveAll();
18 } 18 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool PrefChangeRegistrar::IsManaged() { 80 bool PrefChangeRegistrar::IsManaged() {
81 for (std::set<ObserverRegistration>::const_iterator it = observers_.begin(); 81 for (std::set<ObserverRegistration>::const_iterator it = observers_.begin();
82 it != observers_.end(); ++it) { 82 it != observers_.end(); ++it) {
83 const PrefServiceBase::Preference* pref = 83 const PrefServiceBase::Preference* pref =
84 service_->FindPreference(it->first.c_str()); 84 service_->FindPreference(it->first.c_str());
85 if (pref && pref->IsManaged()) 85 if (pref && pref->IsManaged())
86 return true; 86 return true;
87 } 87 }
88 return false; 88 return false;
89 } 89 }
OLDNEW
« no previous file with comments | « base/prefs/public/pref_change_registrar.h ('k') | base/prefs/public/pref_change_registrar_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698